Let the time taken by the train to reach the station B from station A be 'T'
The distance travelled both the times is same,
So as per the data we have,
Distance = speed *time, so
So, if the train travels at 100 m/h then it reaches, 30 min late i.e
D = 100 *(T+0.5) 30 min = 0.5hr
if the train travels at 120 m/h then it reaches, 15 min early i.e
D = 120 *(T-0.25) 15 min = 0.25hr
so, solving both the equations, we have
100*(T+0.5) = 120*(T-0.25)
T= 4hrs and distance = 450 miles