From the Law of Conservation of Linear Momentum, we know that:

Where v₁, v₂ are the initial velocities of masses m₁ and m₂ respectively, and v₁', v₂' are their final velocities.
In the given problem, the mass of the second particle is unknown. Isolate m₂ from the equation:

Replace the data into the equation to find m₂:

The initial velocity of the second particle is 0 because the problem says it is stationary.

Therefore, the mass of the second train car is 2kg.