What makes you think that Madara can beat Kaguya, if her sons don't even stand a chance?
He has different jutsus and a much greater amount of experience fighting than hago or ham and kaguya. They only ever had one fight and that was against each other..
Also hago nor kaguya nor ham had 3 rinnegan...the manga confirmed that more rinnegan equal more power. Madara had 3.
Hago and kaguya were juubi jins.. But people think aside from the god tree giving kaguya more chakra that without it she had more and that's not true.
Madara surpassed hago....hago said madara used the rinnegans to reach his power and said madara was going to use IT to reach kaguya power... Hago saying that means madara surpassed him.