Well, first of all, before the PC crowd came along, it was “no MAN born of woman is greater than John.” (Which of course, since Mary is a WOMAN, was fine!)
Also, a big case can be made for the ‘rest of the passage’ --the one about the 'least in the kingdom being greater than he." I don’t think Mary is the least in the kingdom, but even if she were, that would make her greater than John, correct? So I don’t see any contradiction whatsoever.
Remember too that the kingdom isn’t ‘time-bound.’ If it were, then nobody who had lived and died before Jesus’ death and resurrection could have been part of the kingdom, right? So obviously people could be part of the kingdom even if they lived long ago (like King David). . .meaning again that Mary could (obviously) be part of the kingdom, therefore ‘greater’ than John. . .