v/2
This is an exercise in the conservation of momentum.
The collision specified is a non-elastic collision since the railroad cars didn't bounce away from each other. For the equations, I'll use the following variables.
r1 = momentum of railroad car 1
r2 = momentum of railroad car 2
x = velocity after collision
Prior to the collision, the momentum of the system was
r1 + r2
mv + m*0
So the total momentum is mv
After the collision, both cars move at the same velocity since it was non-elastic, so
r1 + r2
mx + mx
x(m + m)
x(2m)
And since the momentum has to match, we can set the equations equal to each other, so:
x(2m) = mv
x(2) = v
x = v/2
Therefore the speed immediately after collision was v/2