The incident occurred in the Songkhla seaside city on Tuesday morning.
The victim, a 30-year-old company employee, noticed someone holding a mobile-phone camera below the cubicle door, shouted out in anger, and was able to emerge in time to catch the youth.
He summoned police but said he didn’t want to file charges, merely have the incident recorded as a warning to the teenager.
The youth was reprimanded and released.