Explanation:
In train's rest frame, the speed of photon is [tex]c[/tex] and the proper length of the train is [tex]L[/tex]. The time taken by the photon to cross the train is [tex]t=\frac{L}{c}[/tex]
In ground frame, the speed of the photon is given as follows:
[tex]v_{x}=\frac{v_{x}+v}{1+\frac{v_{x} \cdot v}{c^{2}}}[/tex]
[tex]=\frac{c+v}{1+\frac{c v}{c^{2}}} \\=c[/tex]
The speed of light or photon remains same in every frame of reference.
Now, the speed of train is very less as compared to the speed of photon so that [tex]v<c[/tex] So that, [tex]\frac{v}{c} \ll 1[/tex]
The length contraction in the ground frame is given as follows:
[tex]L^{\prime}=L \sqrt{1-\frac{v^{2}}{c^{2}}}[/tex]
[tex]=L[/tex]
Time taken by the photon to travel the length of the train in ground frame is .