Kaguya was far above Madara. Far far far, to the point that Madara's body couldn't even handle Kaguya's chakra.
Rikudo Senjutsu Naruto was able to hold his own more than decently against Kaguya, his performance was good against someone far stronger than Madara. Not to mention that previously Naruto could easily counter what Madara did (Linbo with Rikudo Senjutsu sensing and Kage Bunshin no Jutsu/Jiton: Rasengan and Chibaku Tensei with Gudodama Rasenshuriken), without bringing out his big guns (the chakra avatar or the powered up multiple version of Rasenshuriken for example). And Linbo and Chibaku Tensei are some of Madara's strongest techniques. If Naruto could destabilize Kaguya with his Bijuu Rasenshuriken barrage, he would surely do the same to the much weaker Madara, and then pull out his Bijuu/Juubi chakra and defeat him.
Dual Mangekyo Sharingan Rikudo Kakashi was able to show an impressive, out-of-the-world performance, against a powered up version of Kaguya, that powered up herself compared to how she previously was, by absorbing a lot of chakra by the IT victims. Kakashi's feats against powered up Kaguya eclipse by far both Naruto and Sasuke's feats against pre powered up Kaguya. Who is still far stronger than Madara ever was. With the perfect usage of the Kamui powers enhanced by Rikudo chakra, Kakashi could make Kaguya's giant form (that troubled Naruto and Sasuke) look like a joke, defend himself from Kaguya and attack, blitz and wound her in a brief 1 vs 1, and neutralize her last counterattack. If both his brain and brawns were effective against Kaguya, he can surely do even better against the less powerful Madara, who gets all his attacks evaded with Kamui phasing, then blitzed with Kamui Raikiri, and warped away with the left eye long range Kamui.
Might Gai can also still defeat Madara, one or two Rinnegan don't change the fact that Gai is simply too fast and powerful for Madara, he can blitz him and kick his head off. He didn't kill Madara with Night Gai because he aimed his ougi to the chest, for plot reasons, because if he aimed to the head he would have vaporized it, killing Madara. Who can have all the power and the techniques you want, but isn't even making in time to use them against 8th Gate Gai, sadly.