Some of this is outside anybody's control. People are rude on trains and nobody arranged for it.
What is partly yours is the accounting. Most days contain more consideration than gets recorded — the driver who waited, the stranger who moved a bag so you could sit down, the colleague who didn't mention the mistake. Rudeness is loud and courtesy is silent, so the books come out wrong.
Expecting to be treated decently is no guarantee of it. It is, though, where most people start noticing when they aren't.