In principle, YES.
Remember, temperature is related to the velocity distribution of the particles inside the gas. The key word here is $collision$.
Accelerating the train and suddenly stopping it is akin to shaking a container that contains fluid once. The sudden acceleration and deceleration of the contained will impart momentum from the wall of the container to the particles inside. I see two cases.
(a) If the container contains liquid and is not completely full, you could increase its temperature because you are imparting momentum of the particles inside the liquid by virtue of them sloshing inside the container.
(b) If the container contains liquid and is completely full, you could increase its temperature in the same principle but not significantly. Similarly, for a gas, while in principle you could have the same effect as in a container filled with gas, the density of the gas is so much lower than the liquid, the effect would have to be negligible.