Their motion is relative to the air/winds. So if the train is moving at a constant velocity with no air currents within the compartment, the fly/bird wouldn't have to sync its speed with the train.. It will fly inside the compartment just as it would fly around in the open air.