Thomas really has to go to the bathroom, so what two yes or no questions can he ask to figure out which bathroom is which?
First he asks “Is this the bathroom for men?” (while pointing at one of the bathrooms). Then he asks them if they said whatever they said (ie “Did you say ja?”). No matter what his second response will mean yes. So his second response can be compared to his first to tell if the bathroom he pointed to is correct.
If the second response is different than the first then the bathroom is not the bathroom he wants. If it is the same then it is the bathroom he wants.