The unstated premise of the thought experiment is that the light ray's movement IS dependent on the movement of its source. If it was independent of the speed of the source, then the observer on the train would detect a shift in the contact point relative to the emission point. This is not observed when the source is moving at constant speed. But it is observed when the source is accelerating.
More information about formatting options