Was it just that they picked up the basics of another language just for trading reasons? literacy rates in ones own language for the lower classes e.g. traders was very low so without the ability to practice writing down and learning how did people learn a foreign language?
So actually in your question there are really two questions.
How did people learn a foreign language without writing?
How did traders get around language barriers
However there are actually a couple problems with the premise:
Literacy isn't required for being multilingual
Literacy in multiple languages isn't needed to conduct trade in those languages
You don't need to write down a foreign language to learn it.
Traders might have been "low class" but this doesn't necessarily mean what you might think it means.
For the first question:
What you're thinking about is the way language education is formally conducted in modern schools, where you buy the text book, the teacher instructs you from lessons in the book, you do some written exercises and presumably learn something about the language. In Asia you'll find the tradition is much more focused on written works at the cost of oral proficiency.
But this is not how most people in the world have traditionally learned a second language. The more usual way is simply through immersion. This is how missionaries had typically learned the languages, especially when they were some of the first of their country to do so. Most of the earliest dictionaries and English/Spanish/whatever textbooks in these places (in the kinda-modern era) were coming from missionaries and published by mission presses.
But actually you don't need to go spend a year in another village to learn a language either, since someone else already has and you can "hire" them as translators.
Now the second question:
"Hire" is in scare quotes above because sometimes they were hired and sometimes they were kidnapped as children so that they could learn the language of the kidnapper. This was a common practice at the time and many of the early interpreters in the Americas were no Europeans but rather natives that had been taken to Europe, converted and taught the language (be is Spanish or what have you). This was the most usual way that people were communicating across continental linguistic divides.
Later other people started to learn the languages to some degree.
In other situations, missionaries were often used. Throughout the period of British opium smuggling in China, including the opium wars, missionaries worked closely with smugglers acting as interpreters and cheer teams (for despite claiming to hate the drug they were absolutely reliant on the smugglers to "open" China and provide them passage once it was open). Most of these early missionaries had been stationed in places like Macao and later Hong Kong, and there had learned languages like Cantonese, Hakka and Classical Chinese.
Again, later, other people started to learn.
But, just because the average person is illiterate that doesn't mean every one is, again we can look at merchants. Also in this period (Opium Wars era), merchants often played the role of interpreter. They may have been looked down upon in Confucian world views, but that didn't mean they couldn't read or write. How society sees a group within itself does not necessarily limit their access to education, especially when education is more decentralised as it was in China at the time as compared to, say, America today. Reading the classics was something a lot of urbanites spent time developing the skills to do.
And then finally you have things like artificial trade languages. Chinese Pidgin was such a language. In places like Canton and Shanghai foreigners weren't usually permitted to learn Chinese and foreigners usually didn't want the locals serving them to learn English, so a pidgin was developed. So "long time no see" comes from this, as does the word "pidgin" to mean this kind of speech variety, being an approximate pronunciation of the word "business", as that's what it were used for.
Note that I'm answering with broad strokes but let me know if you want more detail on any of the above. My internet connection is pretty horrible right now so I've not bothered to put in a bunch of sources and relevant passages, but I can come back in a few hours when I have better cell signal and address any follow up questions then.
See also: