I got and this is how I arrived at my answer:

T=time for journey with speed 30Kmph

t=time for journey with speed 60Kmph

Think of two trains: train 1 is moving at avg. speed and Train 2 is the train given in the question.

During first part the difference in the distance covered by these trains would be:

(42 6/17 - 30)T

During second part the difference in the distance covered by these trains would be:

(60 - 42 6/17)t

As we know both trains cover the same distance finally so net effect of the differences would be zero.

(42 6/17 - 30)T-(60 - 42 6/17)t

(I multiplied time with speed to calculate distance)