All Nagato has to do is absorb some chakra and then he can win, or if he starts healthy then he can win.
Madara does have the Rinnegan but he's not a master with it like Nagato is, he never grew up using it like Nagato did so Nagato is way more adept at using it.
Nagato on his own is way more powerful than Pain so I think he could take it.
He took on Itachi, Naruto and Bee at the same time. Whereas Madara got smashed by Tsunade even if he didn't die Tsunade basically got one over him...Tsunade...
Also Madara doesn't even use the Rinnegan that much he's more Sharingan based in which case Nagato would probably win if he was healthy and had full control of his body.