Okay. Take into all accounts before making deductions.how come naruto defeated nagato who destroyed konoha and nobody could stand up to him...and naruto is still not yet at the level the 4th was... and are you forgetting the fact that the 4th defeated madara within minutes of meeting him forcing him to lose his hold on the 9 tails? now what do you think will happen if the fourth had a whole day to fight madara?
Pain never set out to beat Naruto, only to capture him. Naruto would of die more than once without the intervention of Hinata and Minato.
Second of all, Naruto was given intel on pains abilties, thus giving him an advantage, on top of this, he had clones at mt. myoboku for preperation.
Also, pain was dramatically weaker than a 100% pain. He used shinra tensei, a move that can shorten his life span, as well as this, one of the paths were unable to fight during the start of the bout.
There are probably a few minor things I'm missing too.
On to topic; the fight between madara and minato is sort of eh.
Madara is a former shell of himself, meaning he is not nearly as strong as he once was. Also, his plan had failed, there was no reason to stick around and fight. In the end Minato died, Madara lives. What's more to say? the damage was done thanks to madara.