Here's my little hot take on this:
Frankly, when someone here says "run away" as a first resort - as either a suggestion or something that they themselves would do - remember that we're on a martial arts forum. I think some people are going to say what they think they're supposed to say, at the expense of their own honesty. Nobody here wants to be "that guy" who says that he'll knock the block off of any man who crosses him. Things won't end well for you if you say that on a martial arts forum. Even on the internet in general, nobody wants to be the "internet tough guy," some will avoid it to the point of overcompensating by saying they'd run away.
However, my experience out in the world is a lot different from what I've seen people claim on line. I've seen plenty of grown men fighting, and can probably count on one hand the number of times I've ever seen a man run away from another. In fact, I can only recall one off the dome - because it actually happened on my front yard when I was 15. A male friend of my mother's was confronted by another man, and ran off because he was scared. Everyone there - included me - busted out laughing at him. I lived in that neighborhood for three more years, and he wasn't able to live that down up to the point I left.
I've seen far less instances of men running away than instances of men who knew they were outmatched simply taking the beating, whether they fought back or not (most did).
Truth is that showing fear empowers the other person. Match their aggression, and it throws their confidence off. That's the more desirable outcome, in my opinion.
In the case of a woman dealing with a male attacker, it's not the same. First, women aren't expected to be able to fight men. Generally speaking, when a woman matches a man's aggession, she's hoping that men standing by are going to help her. That's not her being brave. That's her believing she's going to get the favorable outcome. And the male aggressor knows all of this. Also, there are zero social consquences for a woman who runs away from a man.