I hate versus threads. That said, I think there are a few variables here.
Madara:
-Edo or real body
-One Rinnegnan, both Rinnegan? Blind?
-S06P Madara, or dual-Rinnegan Madara?
Kaguya:
-Is BZ feeding her intel?
-Who acts as host for her?
Based on manga facts, it seems that BZ greatly feared Sasuke + Naruto working together against Kaguya. Kaguya's battle capacity seems fairly limited, and she seems to not really understand human emotions. Black Zetsu was the real danger. Kaguya simply had a lot of disadvantages on her own:
-Limited battle experience
-No understanding of the modern world
-Being a woman (yeah, I went there)
-Having little to no will of her own
Madara has her beat in most regards. If Madara has dual Rinnegan it's a tough fight but I think he wins due to Rinbo techniques. Madara's answer to Gravity technique? Cancel it with Rinnegan, of course. Kaguya seems to have few answers to taijutsu, which Madara excels at. Once Madara gets in close-range, it's over.
Peak Madara also had the following on his side:
-Perfect Susanno
-9 TB chakra, minus half of Kurama
-RSM to at least most of the extent Nardo had it
-Hashirama's Super Sage Mode and Hashi's healing factor
-Rinnegan techniques
-Rinbo.
Being blunt, Madara became absurdly OP. Thus they took him out with plot, by having BZ betray him. Most of the Japanese fanbase widely regarded this as an ass pull on Kishi's part. Manga cannon Madara schools Kaguya with ease, provided he has dual Rinnegan and sage chakra.
LOL @ Madara not having sealing techniques. REALLY NB?
-Rikudō Jūbi Kyū In
-Chibaku Tensei (used to seal the damn Juubi in the first place)
-Creation of All Things
-Absorption Seal
-Phantom Dragons Nine Consuming Seals (which we can safely assume Madara taught to Obito before his first death)
-Demonic Statue Chains (implied this was used to seal Kaguya into the Gedo Mazo to begin with... der)
I mean seriously, without Black Zetsu Kaguya isn't even top 5.
Edit:
Kaguya's theoretical power goes beyond Madara's. But Madara has battle experience and powers Kaguya didn't have. Plus he was better at reading people. Sorry to say I think he would easily win