As we tune in, the two locomotives are 5.0 km apart, and they start moving toward each other. Each one moves over the ground at 95 km/hr.
Consider the gap between them. One locomotive cuts length off of his end of the gap at the rate of 95 km/hr, and the other locomotive does the same thing to HIS end of it. So with both of them in motion, the gap between them is getting shorter at the rate of (95 + 95) = 190 km/hr. I'd call that their "closing speed".
At the rate of 190 km/hr, how long will it take to eat up 5 km of gap ?
(5 km) / (190 km/hr) = 5/190 hour = 1/38 hour = about 1 minute 34.7 sec .