Let the mass of 2500 kg car be 
 and it's velocity be 
 and the mass of 1500 kg car be 
 and it's velocity be 
 .
After the bumping the mass be M and it's velocity be V.
 By law of conservation of momentum we have 
 

 2500 * 5 + 1500 * 1=4000 * V
 V = 14000/4000 = 7/2 = 3.5 m/s
So the velocity of the two-car train = 3.5 m/s