When my daughter was that age I would stand by the entrance to the women’s restroom and give instructions to my daughter on how go in there and do her business. Invariably, a mother would offer to take her in there. This was in an era when you could still trust people to not do anything bad.
It must be hard to teach children how to balance a helpful adult and an inappropriate adult in that situation. Not a conversation I can imagine how to have. Standing outside the bathroom was a really good thing. It showed everyone that your daughter had a protector.