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(!?)