Hydrogen fuel cell multiple unit vehicles are acquiring a central role in the transition process towards carbon neutral trains operation in non-electrified regional railway networks. In addition to their primary role as a transport mean, these vehicles offer significant potential for applications in innovative concepts such as smart grids. Compared to the pure electric propulsion systems, fuel cell technology allows for cogeneration processes by recovering generated heat in addition to the provision of the electrical power. This paper presents the analysis of fuel cell hybrid-electric multiple unit vehicle employed in regional railway transport during regular service, and in vehicle-to-grid application during the off-service hours, providing the electrical and thermal energy for stationary consumers in terminal stations. The system dynamics are modelled using a backward-looking quasi-static simulation approach, with implemented real-time optimization-based control strategy for managing the power flows between different components. In a case study of selected vehicle and railway services in the Netherlands, the fuel cell system showed average hydrogen consumption of 0.4 kg/km, with the overall electrical efficiency of 38.89%. In vehicle-to-grid scenario, the system satisfied complete stationary power demand, and provided about 327 kWh of thermal energy during 2-h operation, reaching the overall cogeneration efficiency of 66.81%.