Let d be the distance travelled to the train in kilometres.

Let s be the speed travelled to reach the train on time in km/h.

Let t be the time taken to reach the train on time, in hours.

d = st

d = 5(t+7/60)

d = 6(t-5/60)

5(t+7/60) = 6(t-5/60)

5t + 35/60 = 6t - 30/60

t = 65/60

d = 5(72/60) = 360/60 = 6 kilometres.