Madara was indeed powerful.
Not even Plot no Jutsu would have saved Naruto and Sasuke from Madara had they faced him without Kaguya's intervention. Kishi even admitted that Madara had no weakness. In other words, Kishimoto couldn't come up with a plot in which Naruto and Sasuke outsmarted, outwitted and overpowered Madara. The guy had the battle sense, the intelligence, the power, everything. He had the brains and the brawn.
Therefore, Kishi introduces Kaguya, who was, although more powerful, nowhere near as intelligent as Madara was and dumb enough to be sealed and "defeated." Even she had a weakness (lack of battle sense, hence being sealed - There's no way that plan Team 7 came up with to seal Kaguya would have worked on Madara).
In terms of who can actually beat Madara, maybe Hagoromo? After all, it was stated that only he was the one that fully mastered the Rinnegan and all, has the Sword of Nunoboko, etc. Though not even he was shown with the Rinne Sharingan...
I for one tie Madara and Hagoromo... Madara had the Rinne Sharingan and he even used Kaguya's jutsu like Shin Jukai Kutan and Infinate Tsykuyumi! Even Madara's Chibaku Tensei was casual and look how powerful it looked. We have never see Madara go all out... That tell us something don't you think?