To meet the increasing demands for passenger data rates, modern railway communication networks face significant challenges. The advent of 5G communications after the long-term evolution (LTE) and LTE-Advanced (LTE-A) systems provides several technological advances to address these challenges. In this paper, after reviewing the main 5G communication aspects for modern railways, we present methods to ensure connectivity and energy efficiency for the passengers’ user equipment (UE) through the use of mobile relays (MRs) on top of the train wagons in conjunction with intelligent resource allocation. Relevant challenges to train connectivity are also presented, and suitable solutions are outlined.