Let D be the total distance (say in meters) traveled by the train and T the time (say in seconds) it takes to do so. (Assume the train moves in a straight line in only one direction.) Then the average velocity of the train as it covers this distance is
v (ave) = D/T
We're told the train can traverse a distance of D/4 in a matter of T/2 seconds if it moves at a speed of 5 m/s. This means
D/4 = (5 m/s) (T/2)
⇒ 5 m/s = 1/2 D/T
⇒ v (ave) = D/T = 10 m/s