In the reference frame fixed to the train, the distance between the two events is obviously equal to l. Suppose the train starts moving at time t=0 in the positive x-direction and take the origin (x=0) at the head - light of the train at t=0. Then the coordinate of first event in the earth's frame is

For the two events to occur at the same point in the reference frame K, moving with constant velocity V relative to the earth, the distance travelled by the frame in the time interval T must be equal to the above distance.

The frame K must clearly be moving in a direction opposite to the train so that if (for example) the origin of the frame coincides with the point x1 on the earth at time t, it coincides with the point x2 at time t+τ.