And how do you deal when someone felt sick inside a toilet? Or when a little child locked himself and can't unlock?
You add a mechanical override cylinder. Conversely, I could ask "how do you deal with electronic failures that leave the door locked?"
Or when someone without a ticket went in?
If you got on the train, you already have a ticket. Or do you need a separate ticket just to enter the toilet(!?)