Integration of real-time traffic management and train control for rail networks