Suppose we have a train moving. When the origin of train's frame coincides with the origin of observers frame; the the time is set to zero. At that very instant, a photon is emitted from train towards the direction train is moving. After time $t$ measured by observer at rest the photon will be at a distance $ct$ and the train at a distance $vt$; but the photon is at a distance $ ct-vt$ from the train, now the time that the passenger on train measures for the photon to reach that point is the distance divided by the velocity of light ( which of course is $c$) so
time measured by observer on train is $t'=\frac{ct-vt}{c}= (1-\frac{v}{c})t$ . where $t$ is time measured by observer at rest.
Where is the mistake in this reasoning?
