While the Rinnegan is the most powerful eye technique, it doesn't mean he is a stronger ninja. Remember back to the when Naruto fought Neji. Neji had the byuakugan while Naruto of course has no eye techniques, yet Naruto was still able to win the fight. There are many more factors to take into consideration than who has the stronger eye technique. Pains been alive for how long? 20 years? If everything we think we know about Madara/Tobi is true, then Madara has to be pushing 100. 80 more years to learn jutsus, get stronger, and gain fighting experience/knowledge.
At this point, I would have Madara above Pain by quite a bit.
Comparing powers sometimes doesn't gives the exact picture. Theoritically eye techniqes are strong yet KB managed to beat Sasuke and later on fool him. Naruto was able to defeat both Neji and Pain. Sometimes just having the strongest weapon is not enough. Naruto also uses his abilities to connect and talk to settle the fight...
The fight in the end of the valley was not in Madara's favour. Yet, Madara is alive and Hashirama ended up dead some time after. I think Madara was also hurt (Itachi called him a shell). But the fight between them was probably a draw and Madara retreated.
Madara is probably insanely strong, still he doesn't take fatal risks. He likes to use puppets instead . Itachi, Nagato, Sasuke, even Kyuubi....
We can say his strengh is not only physical, he is cunning and manipulating as well. He clearly has his own agenda but, he managed to fool Nagato and use him for his own purpose. He already beat Nagato.