People learnt foreign languages. That's the answer. It's not even that difficult.
For but one example, as Eleanor Dickey's recent book, "Learning Latin the Ancient Way" shows, there were all sorts of learning materials for teaching people Latin (usually for native Greek speaker). Of course, Latin for Greek speakers would be a much greater demand than other 'languages' in antiquity, but it illustrates my general point - people learnt, and taught, other languages.
which I think is unlikely as hard how it is for adults today to learn languages
I can only assume that you vastly overestimate how difficult this is. Assuming you have the time and resources, adults can indeed learn foreign languages. It's not 'easy', but it's not that hard either. People in antiquity hired private tutors, or employed slaves, who would teach them the relevant language.
Alternatively, you find someone from a region with overlap between languages who has grown up bilingual. Bilingualism (and tri- and multi-) is still very common in the world today, simply because of language distribution and usage. There's no good reason to think there weren't bilingual people in antiquity who grew up with the use of multiple languages through exposure to them.