To be fair, Madara could have easily beaten Gai with limbo that he didn't use for some reasons. Gai also had no way to bypass the gudo spheres by himself. Rinnegan techniques like almighty push, also seemed to have been forgotten by him despite being the original rinnegan user