i don’t think this story of the Tower of Babel necessarily has issues when its read on its own terms, which you appear to be discounting, or at least not recognizing, namely that the order of the narrative isn’t reflected in the order of the text…
the geneologies given in Genesis 10 are actually a bit of a diversion from the ebbing narrative found towards the end of Genesis 9, consisting of a reflection of the three named sons of Noah in conjunction with his death…these geneologies aren’t advancing any story line…instead they’re radiating into background detail about the three sons of Noah for their own sake…the fact that these geneologies in Genesis 10 precede the narrative of the Tower of Babel in the first part of Genesis 11 is neither here nor there…it isn’t an indication that everything within their reach transpires before the Tower of Babel event…
the opening of the narrative of the Tower of Babel, in Genesis 11:1, explicitly states that the entire world used a single language…this isn’t a contradiction with the observations in Genesis 10 that each of the sons of Noah were using separate sets of related languages…rather, it’s an indication that the Tower of Babel preceded the dispersion of the sons of Noah into various parts of the earth, and in fact gives some explanation for that dispersion…
notice that the geneology of Shem in the second part of Genesis 11 omits all mention of Joktan, son of Eber, who is listed as the father of 13 sons in Genesis 10…this isn’t a contradiction because the second part of Genesis 11, unlike Genesis 10, is setting up the ancestry of Abraham (Abram), the next central subject in the narrative, and so is focussing on Peleg, the older brother of Joktan, who is the direct ancestor of Abraham…the note in Genesis 10:25 about the division of the earth in Peleg’s lifetime could mean that the post-Babel dispersion came as a 5th generation post-flood event, which seems reasonable…
so the author of Genesis, who is traditionally believed to be Moses, isn’t contradicting himself in this story of the Tower of Babel…as in his accounts of the Creation and Flood stories, his overall narrative contains occasional diversions from that narrative for the purpose of providing detail that momentarily suspends any concern for linear time…were the author of Genesis writing in our time, and our context, no doubt he’d find a way to merge the detail he finds salient seamlessly into a presentation that reflects linear time…but he isn’t, and therefore he doesn’t…i don’t see that this is a problem…