Some of the slurs were directed at two female passengers, one of whom was wearing a hijab, police said. At least two men tried to calm the man down, but "they were attacked viciously by the suspect," Portland police spokesman Pete Simpson said at a news conference.
"It appears preliminarily that the victims - at least a couple of them - were trying to intervene in his behaviour, de-escalate him and protect some other people on the train when (the suspect) viciously attacked them," Simpson said.
The two men killed in the attack were Ricky John Best, 53, and Taliesin Myrddin Namkai Meche, 23. A third victim, Micah David-Cole Fletcher, 21, is being treated for injuries that were not life-threatening.
Police arrested Jeremy Joseph Christian, 35, of north Portland. Local media reports described Christian as a "known white supremacist" in the area, and his Facebook page showed a long history of racist and extremist views.