Well no country had a single group really become the majority, Argentina just maybe so I guess you could have a situation like that that ends with 2 official languages.
Those minorities were often quite small. German is coofficial in some places in Brazil so if get like a big minority(40%+) you could get a cooficial status for it. Germany is also bigger and economically more influential so you could have like big German migrant community plus German economic ties and influence with a Central American country.Having a group of people conquer a territory and displace much of the previous population is quite a bit different than what was proposed above (having lots of German-speaking Jews settle in Palestine).
Those are - on a national scale - minority communities. Their national governments have not changed their languages due to immigration. In fact, in all of these cases those minority languages declined as their communities faced pressure to conform to the national language.