Good advice on what to do when you find yourself near a racist mouthy twat who is spouting out their crap at some unfortunate person.
NEVER engage the perpetrator. He (and it is usually he) is looking for confrontation. Instead speak to the person he is abusing. Say hello. Introduce yourself. Shake his or her hand. And just stand with them. Keep talking. About anything. Weather. Bus schedules. Football. This kind of bullying never works against a group of people having a conversation. Usually a single person travelling or a mom with a kid or maximum, two women are targeted.
Form a group of people with and around them if you can. Don’t tell them they are not alone. Just don’t let them be alone. I speak from experience. Once, I encountered a young girl wearing a hijab being abused as a terrorist by a drunk man on a train. I just went and sat beside her and started a conversation with her. After a while, the dude lost interest. I had a lovely chat with a young student from Qatar. She wanted to study literature while her dad was only prepared to pay for engineering or commerce as he wanted her to join the family business. It helped her feel safe and it expanded my horizons.
Doing this won't fix the problem. Until more people do it. Gotta start somewhere.
UPDATED TO ADD: The source of this is apparently a matter of some dispute on Facebook. See the comment thread for a link to another claim for its origin.
Regardless, the idea is sound.