Are you a woman? I ask because that doesn’t seem a likely scenario.
Firstly, if she is being harassed to the point of running, a woman is more likely to go to someone like a shop assistant and start talking to them. People would notice a woman being chased by a man. So I presuming in this fictitious scenario, there is no one else about. In this case I think she’d be delighted to see the cleaner, especially if he were male. She wouldn’t be shocked to see him as she would have been able to hear him and his cleaning materials and see his shoes as there’s a floor to door gap in the single sex loos as she would absolutely used the gap to look out before leaving the cubicle. She’d probably say, can you see if there’s a bloke outside who is waiting round looking like…
Theres not a magic force field round the entrance to the ladies so the last thing you do is block yourself into a room where you are alone with someone chasing you so much you are running.
Constrast this with a real story: I have been in the ladies where a bloke came in after me and waited. That was scary because we were on our own in that block of loos. This was pre mobile phones. I knew he was there and it was a man by the sound of his shoes walking in softly, being able to tell from the way he walked and seeing his shoes from the floor to door gap. He was waiting by my door. I froze and didn’t do anything for what seemed like ages. When I heard the outer ladies door open, he ran out and another pair of ladies shoes I could see and hear came in. I came out and we had a few words about what happened. She said he just rushed out, she didn’t get a good look at him, peered round the door to look under all the cubicles and decided it was safe to come in as she could only see my feet. I didn’t report it because this is the kind of thing woman put up with. This is another reason why single sex toilets with door gaps matter.
If you saw statistics on how many sexual assaults there are in public toilets, you would realise why women don’t think toilets are a place of great safety.