Most bathroom doors open inwards. So practically impossible to kick down if you are on the inside.
My DD got stuck in a friends toilet when she was 10. Similar thing happened. Lock broke. In the end, we only noticed she was missing after about 45 mins. Poor thing was stuck inside. She'd tried knocking and shouting out of the window but too many kids & too much noise meant we couldn't hear her.