When two particles collide and the masses of the particles are given, as well as the initial and final velocity of one particle and one of the velocities of the second particle, then the remaining velocity of the second particle is given by the expression:
Which can be deduced from the Law of Conservation of Linear Momentum.
In the given problem, the initial and final velocities of the train car with mass 10kg are given, as well as the initial velocity of the 20kg car:
Replace those values into the given equation to find v₂':
Therefore, the velocity of the 20kg train car after the collision, is: -25 m/s.