The accepted answer is not 100% correct. Also the question in itself does assume a thing that is not true. As long as the child of your vassal duchess and the foreign king does not have any land on his own he is not considered your vassal, only part of your court.
Besides that, if we assume that the child is the sole heir of both, your duchess and the foreign king, the order of the deaths play a big role. Consider following:
If the foreign king dies, the child will inherit his kingdom title and instantly be either an independent king of himself or a vassal of another emperor, which was the liege of the deceased king. His mother still holds a duchy in YOUR kingdom and therefore is still your vassal. If your mother then dies, your kingdom rules play a big role. If you have rules enacted to forbid outsider to inherit realm titles (legalism 4 is needed for that rule to be enabled) the next in line will inherit, NOT the new king. Otherwise, the duchy will be plucked out of your realm and added to his kingdom.
Now, if your duchess dies first, the child will inherit her duchy, and because she was your vassal, he will be your vassal (since the title is part of your realm). When the king dies afterwards, their will be no rule which will stop this child from going independent from you (with your duchy) since his title is the same rank as yours and it is not possible for kings to have vassal kings.
My suggestion, if you really want to keep the duchy in your realm, either try to make that child your heir aswell (so you'll get both kingdoms) or try to rip the duchess of of her title and award the title to someone else.