Solution (source code)

= Solution

With light signals, $u=c$, the train-frame <relativistic velocity-addition formula> gives signal velocities $+c,-c$. The endpoints are equally distant from the source in that frame, and
$$
\boxed{t_A=t_B=\frac L{2c},\qquad t'_B-t'_A=-\frac{\gamma Lv}{c^2}\neq0.}
$$
The two reception events are simultaneous in $S$ but not in $S'$: in the station frame the rear moves toward its light signal while the front moves away. Directly, $\Delta x=x_B-x_A=-L$ and $\Delta t=0$, so the <Lorentz transformation> gives $\Delta t'=\gamma(\Delta t+v\Delta x/c^2)=-\gamma Lv/c^2$. This is <relativity of simultaneity>, concerning spatially separated events; it does not contradict the invariant light speed or the causal ordering of events on a single observer's <world line>.