There is no one right answer but several of them.
If you’re not confident in that situation you can help you probably ought to stay out of it.
If you’re a woman with young kids, particularly young kids accompanying you, you probably ought to stay out of it unless you’re confident you can intervene without putting them or yourself in any danger.
If you’re a young father with kids you ought to consider the potential outcomes for them if you get involved.
Morally, I just couldn’t stand by and watch a woman get stabbed or slashed if I thought there was anything I could do to stop it.
The value in these discussions is that everyone gets the mental exercise of, “What would I do in a similar situation”, and gets the mental training to make a sound decision.