Pains only goal was to capture Naruto and not to kill him. If pain had fought with the intent to kill and not held back the fight would’ve ended a lot sooner. Pain was also nerfed during the fight. And obviously, we all know Naruto had plot armor which every MC has but this is a special case were Naruto had 10 advantages.
Before Pain started his fight with Naruto, Pain had literally fought everyone in the leaf village and defeated them. The Deva Path destroyed the entire village with one Jutsu to the point it was an unrecognizable wasteland.
The Almighty Push was so Destructive, the deva path lost of a lot of chakra and had to recover which gave Naruto a huge advantage.
Naruto had intel on all Pains abilities. Which heavily assisted him. Unlike those before him that died for this intel.
Naruto also had the support from the Toad Sages and all of Mount Myobuku. Gamabunta, Gamaken and Gamahiro being the most prominent. Each of these guys being strong enough to partially fight off a tailed beast.
Naruto also got help from Hinata which may not seem like a big deal but after watching her “die” by pain. Naruto completely lost it and let the 9 tails take over his mind. Kurama fighting for him also helped him in the long run. Pain managed to fight off the 9 tails in V2 state and all the way up to the 8th tail. Pain also tanked a bijuu bomb at point blank with minimal damage. This bijuu bomb had enough potency to nuke a large portion of the village.
Pain used planetary devastation which in size scale is also another attack that could’ve totaled the village. Nagato could have even made this on an even larger scale to truly seal the 9 tails.
Naruto also got help from the 4th hokage. And his father Minato namikaze. Who repaired his seal and put him back in the fight. After using almost all of his power Pain was very weakened at this point. But still managed to fight off another use of Sage mode from Naruto.
Nagato with pretty much no chakra left decided to hear Naruto out and told him his story and related to him. Pain entrusted the future to him and sacrificed his life to revive everyone in konoha he had just killed. Konan even stated if he had enough chakra he could have survived the jutsu. Which speaks for how much life force an Uzumaki actually has.
So just how powerful was Nagato?