Clash Royale Mini Pekka vs Barbarian - Who Is Better?
A Barbarian vs Mini Pekka conversation is a tough call. Having played a lot with Royal Giant decks, Giant decks, and Hog Rider decks, both will wreck your tank/win condition. They both play the same role in the current meta, that is to take down tanks (Royal Giant, Hog, Giant). They will shred a tank in a matter of seconds, rendering the push null, so quick thinking and action is required to keep your tank alive.
I will break it down in the perspective that you are playing the tank, and the enemy is countering with Barbarians or Mini Pekka. So for the explanation below, I am going to assume you are playing Giant, and the enemy drops one of the two cards. Nothing else is on the field at this point. You are going to start at -5 elixir for the Giant, and the enemy will be at -4 for the MP or -5 for Barbarians.
Barbarians, in my opinion, are harder to counter quickly enough to have your Giant still alive. This usually requires Fireball, and either Zap, Ice Wizard, Princess, ect. The only case where this come out as a positive trade for you is if you use the Fireball and a splash troop, as the splash troop will still be alive and able to support your Giant. Fireball and Zap deal with it so quickly though, that the Barbarians might only get 1-2 hits off for a -1 trade, but there is nothing behind your Giant to push. If you are in a scenario where you can't kill them completely, it is almost better to just counter the Barbarians after they kill the Giant. I will often throw a Princess in there to just chip the Barbarians down while they shred my tank. They will cross the river nearly deal, and my Princess will still be alive to force a response.
Mini Pekka Review
Mini Pekka is a bit easier to counter, but will still likely shred your Giant. I like to play a combination of the Ice Wizard, and a Mini Pekka of my own (if they don't have a tank) or some other high DPS melee troop (Goblins, Valkyrie, Knight, ect.). The Ice wizard will slow the attacks and movement so the MP won't be able to stay on the Giant, and will retarget while the giant still has a good amount of health. The MP won't be able to kill the Valkyrie, so she will be able to support the Giant further. If you don't have Ice Wizard, then you will need to Zap it at the right time, and your Giant will be hurting. If you time the Zap correctly, the MP will retarget onto whatever you threw at it, and your troop will likely survive.
Which One Is Better Against Hog Rider?
In terms of the Hog Rider, the Barbarians are better, at a -1 trade. Both the Mini Pekka and Barbarians will deal with the Hog Rider with minimal damage to the tower, but the Barbarians are more of an obstacle, and usually result in 1 less hit.
I have to disagree the your statement that the Mini Pekka isn't very good against the Hog. Assuming there is nothing backing it up, the Mini Pekka can kill it before it gets two hits off. It just requires good placement, and quick fingers. If you drop the Mini Pekka 4 tiles above the tower the Hog Rider is attacking, it will kill it before it gets 2 hits off, something before it even hits the tower.
I personally prefer using the Mini Pekka in my decks, as it costs 1 less, and hits like a truck. If you can manage to get just 1 hit with the MP onto a tower, it will deal a considerable amount of damage. Barbarians are much easier to stop from getting to the tower, and if they do, they might only get a few hits (assuming the opponent is competent/able to deal with it). The Mini Pekka has a big counter when on offense, and that is swarm troops (Stab, Spear Goblins, Skeletons), and those are all zappable (assuming comparable levels).
I clearly put too much effort into something you probably wanted a 3 sentence response to, but if it invokes some thought on your end to consider what would be best in your deck, then I feel like I helped. Good luck!