Lester said he was disgusted to hear about the behaviour.
"I was really disappointed and quite frankly embarrassed," he told the Herald.
But in his post, Lester said what happened next made him "incredibly proud to be Mayor of this city".
"Other passengers intervened and came to the man's defence. A Metlink staff member stopped the train because the abuse continued. They called the police and the offending person was taken away.
"The staff member returned after a 20 minute delay and made a beautiful speech about how this behaviour is never acceptable in NZ. That after 15 March this was even more important today," he wrote.
Lester thanked all those involved for standing up for another and calling out racism.
"It warmed my heart and made me think this is wonderful because the message is getting across and people are willing to stand up and be brave," he said
"A huge thank you to the Metlink staff member for your leadership and being a wonderful example to others.
"He not only settled the situation and acted appropriately and responsibly, but he then was courageous enough to stand up in front of a carriage load of passengers and say why this behaviour is inappropriate."
Lester said he wanted to find out who the staff member was in order to nominate them for a Civic Safety Award and shout them morning tea.
"To every ethnicity represented in our city, you are a big part of who we are and you make our city much richer for your presence. Thank you for being here and thank you for being you," he wrote.
The colleague who witnessed the attack, and wished to remain anonymous, told the Herald the racist offender was a teenage girl.
"It was a little bit intense, and she got quite a bit of stick from other passengers. It wasn't a pleasant scene," he said.
"She was out to piss people off, but I was impressed by how the guard handled the whole situation. I'd never witnessed anything like this before."
Lester said he didn't want to vilify the person, but hoped they would learn from their mistake.
"They need to understand that their words and actions have an impact and that they need to think more wisely about how they behave."
A police spokesman confirmed officers has spoken to a person following the incident.
"The person has been referred to Youth Aid."