I know you mentioned the ancient world but really the formula hasn't changed very much throughout the ages: rote memorization, immersion, and lots of repetition.
If you have an Android device, then you can search on the Google Play Store for language books and find many free, digitized old books from the 1800s about many European and Asian languages from back then.
Here are a few examples:
Italian Grammar (1857) by Ferdinando Ciciloni
Elements of Chinese Grammar (1814) by Joshua Marshman
A Compendious Grammar of the Modern German Language (1859) by Franz C.F. Demmler
In general most subjects have been done and taught this way for thousands of years, going back to at least the Greeks. Mathematics in particular has always been taught the same way (despite numerous attempts in recent generations to replace it with new philosophies of education such as "New Math" in the late 20th century).
If you want to see one of the oldest pieces of great work, albeit for Mathematics, you can check out The Elements by Euclid. You can just Google that one - it's everywhere. Great and sad story behind those books, too, but that's getting off-topic.
The study of languages change over time, with varying degree of focus. This topic might be better suited for that of a linguistic, however I can briefly shed some light on it in a historical context.
The notion of a common Proto-Indo-European language, which we understand today as being the ancestor of such language families as: Indo-Iranian; Balto-Slavic; Germanic; tocharian; Anatolian; Hellenic; Italic; and a few others, stem from the 18th century; so a relatively new concept. This idea of a P.I.E, is attributed to Sir, William Jones, who contributes to the works and ideas of Gaston-Laurent Coeurdoux in 1767, and Van Boxhorn in 1653.^1
I have attached a picture depicting the [differing Dialects of Ancient Greece.](https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/AncientGreekDialects_(Woodard)en.svg/2000px-AncientGreekDialects(Woodard)_en.svg.png)^2 This is a common phenomenon in the Ancient World, where languages would have a fair amount of different dialects. Scholars at the time were no strangers to different languages. The scholars, soldiers, leaders of the time, would be aware of these differing dialects and other languages, due to trade, war, and diplomacy.
After the death of Alexander the Great, we saw a division of his empire, which you will find to be a lead to the answer of your question about language education. Egypt ended up under the control of Ptolemy I, who is known to have sponsor works of the Euclid, a famous ancient mathematician. Ptolemy I founded the Musaeum at Alexandria (~300s - 200s BC), which included the Library of Alexandria. Both of these institutions flourished under Ptolemy I's son and successor, Ptolemy II Phialdelphus.
Ancient scholars from around the known world came to the Museaum, and more than 1,000 would be living there any given time. The scholars would perform lectures, scientific research, and collected large quantities of literature from the known world. In all sense, it would be similar to a modern university.
These institutions were responsible for a lot of the translations of documents from Assyrian to Indo-Iranian languages.^3 The benefit of these institutions is that they would attract scholars from the world, with different language backgrounds, which surely aided in the translation process.^4 /u/tagus is correct about the language learning formula; it's a process of memorisation, immersion, and lots of repetition.
To summarise, Ancient Scholars could learn local languages, and compare them to other known languages, or they could go to academic centres such as the Musaeum of Alexandria, where they would be welcomed by a plethora of foreign texts.
If we fast forward to past the Roman Empire, we can see the Church becoming the main point of education in languages as their taught their religious scholars Ancient Greek and Latin.
^1 : A biography of the English Language: C.M. Millward, and Mary Hayes. 2012.
^2 : [Ancient Greek Dialects, Wikipedia] (https://upload.wikimedia.org/wikipedia/commons/thumb/ d/de/AncientGreekDialects_(Woodard)en.svg/2000px-AncientGreekDialects(Woodard)_en.svg.png)
^3 : MacLeod, Roy. "The Library of Alexandria: Centre of Learning in the Ancient World". 2004
^4 : Kennedy, George. "The Cambridge History of Literary Criticism: Classical Criticism". 1999.
This raises another question for me.
How did the initial translations take place? Not just the education, but, say, the first time someone from Culture A met someone from Culture B, how would they go about learning the other language? Especially for two people who lack any close linguistic roots (Portugal and Japan for example).
Is it a matter of simply pointing at things and then saying the words until you build enough of a base to convey more complicated ideas and translate them?
My PhD is in the history of writing instruction. In the ancient Greek tradition, the basic grammar school curriculum as called the progymnasmata, a set of exercises that introduced students to the basics of reading and writing. It was a prepatory (pro) program to prepare students to study rhetoric and oratory more formally (gymnasmata).
There were several parts of the educational system, including reading poetry (enarratio poetarum), producing speeches based on real or imagined characters (ethopoeia or prospopeia), etc etc. The BYU site linked above explicates the entire educational scheme. You can also read Quintilian's take on the system in his institutio oratoria.
This system of reading/writing survived throughout the Roman tradition and, in modified forms, throughout the Latin Middle Ages. One fascinating way in which the tradition evolved in the medieval period was through neuming, or notating texts for musical performance. As Nicholas Orme has said, “Boys in school began by learning the Latin alphabet … Next, they practiced how to recognize Latin words, pronounce them, and sing them to the rules of plainsong” (From Childhood to Chivalry 145-46). Because of the material conditions of medieval classrooms, there was much reliance on orality and singing. That oral focus survived in medieval colleges, in disputations and oral debate.
Those material conditions mean we don't have much left from the period, as far as student compositions go. Many medieval students wrote on wax tablets because paper was not affordable or widely available. We have some student compositions preserved in the Hunterian v.8.14 manuscript, mostly poems that amplify and abbreviate mythical stories. Amplification (*amplificatio,*or expansion) and abbreviation (*brevitas,*or shortening) were rhetorical exercises in learning how to work with texts. That is, you can look at something like Geoffrey Chaucer's Merchant's Tale, when he abbreviates Claudian's de raptu proserpinae in 4 lines, as a similar rhetorical exercise in abbreviation. Amplification and abbreviation were two important exercises in classical and medieval rhetorical pedagogy.
As a result, the pre-modern grammar classroom did much with language instruction and acquisition, through rote memorization, imitating successful authors, and learning to develop "voice" within the auctoritas of classical authors.
You might also be interested in Rita Copeland's discussion of the translatio studii tradition, or how authors appropriated the authority of classical texts for new aesthetic and argumentative purposes.