Naruto and Sasuke have the moon chibaku tensei seal, Kishimoto said he didn’t know how to defeat Madara at this point. Kaguya had more chakra but she didn’t know many techniques, all she could do with portals, nature control in various dimensions (which wasn’t that OP), and ash bones. Madara not only had all of Hagaromo’s techniques but a mastery of all sharingan techniques and many more, with 3 eyes he was way above just 1 rinnegan, he could have won with more ease than Kaguya imo.