In fact, there are a lot of possibilities, and many of them are attested in the history of natural languages.
Majority language wins. This happened in China at least twice, it was conquered and ruled by foreign people (Mongolians, Manchu), but the ruling class became sinicized. It also happened in medieval France and Spain - they were conquered and ruled be Germanic tribes (Franks and Burgundians for France, Vandals and Goths for Spain), but the majority language of the residents won out.
Most prestigious language wins. This happened in antiquity in the Roman empire, and we see it in many post-colonial states in Africa. There are some prerequisites for that, such as a working educational system helping that.
Pidgins and Creoles emerge, and a Creole wins. This can be watched in Papua New Guinea, where Creole languages like Police Motu and Tok Pisin are becoming the de facto standard of communication.
Something else happens. The case of English is not as clear as my points 1 through 3 suggest: While the majority language finally won, it was heavily impacted and changed by the languages of the conquerors (Normans and Danes).
EDIT Stable multi-linguality. Quite rare in the wild, but Switzerland with a coexistence of Swiss German, French, and Italian is an example. The fourth language of Switzerland, Romansh, is under pressure, despite attempts of language preservation.
EDIT2 Mixed language. This is very rare in the wild, but there are a few mixed languages out there, like Michif - in this language the verb phrases come from Cree and the noun phrases come from French, forming a stable mixed language.