The trip to the train station: t 1 = 2 h, v 1 = d / t 1, v 1 = d / 2, where d is the distance from the train station.
The trip back:
t 2 = 5 h, v 2 = d / t 2, v 2 = d / 5
Also: v 2 = v 1 - 30
d / 5 = d / 2 - 30
d / 2 - d / 5 = 30
0.3 d = 30
d = 30 : 0.3
d = 100 miles.
v 1 = 100 / 2 = 50 mph
We can prove it: v 2 = 50 - 30 = 20 mph
100 miles = 50 mph * 2 h = 20 mph * 5 h
Answer: Average speed on the ongoing trip was 50 mph.