Recall that in an inelastic collision the objects are stuck together after the collision meaning that they will have the same velocity.
The conservation of momentum is given by
We know that momentum is equal to mass into velocity
Where u represents velocity before the collision and v represents the velocity after the collision.
Since it is an inelastic collision, the velocities after the collision combine
We are given the following values,
The direction "to the right" is taken positively and the direction "to the negative" is taken negatively.
Finally, substitute the values into the above equation and solve for final velocity (v)
As you can see, the final velocity of the combined train system is 0 m/s
This means that the trains stopped after the collision.