The vertical component of near-fault earthquake motion is significant and may result in the derailment of trains that are running on bridges. In this study, a shaking table test of a train running on a high-speed railway bridge is performed based on a four-array shaking table and a 1:10 scale model of the train-track-bridge, and the corresponding numerical model is established. The reliability of the numerical model is first verified by test results. Then, with safety and comfort indexes as evaluation criteria, the test and numerical data are analyzed to reveal the near-fault vertical seismic effects on the running safety of trains on bridges. Finally, with the wheel-rail relative displacement of the test and derailment evaluation indexes of the numerical simulation, the near-fault vertical seismic effects on the derailment of trains running on bridges are analyzed to explore the derailment mechanism. The results show that near-fault vertical seismic excitation generally has a negative impact on the running safety of trains on bridges, with a maximum impact of 27% under selected seismic excitations. Furthermore, the negative impact increases with the vertical-to-horizontal peak acceleration ratio. The safety threshold of peak ground acceleration is often reduced due to vertical seismic effects, and the maximum reduction reaches 14.3% under Northridge-01 seismic excitation. In the case of a given lateral seismic excitation, vertical seismic excitation increases the maximum distance that the wheel-rail contact point moves laterally towards the wheel flange and further promotes flange climb derailment. Moreover, vertical seismic excitation reduces the minimum value of the wheel-rail vertical force and increases the possibility of jumping derailment.