The flexible smart traction power supply system (FSTPSS) is a fully electronic traction power supply system (TPSS), which integrates ac-dc-ac traction substations, distributed generation, and hybrid energy storage system (HESS). Compared with the traditional TPSS, the power supply of FSTPSS becomes more diverse, but the randomness of power flow becomes greater. A suitable energy management strategy is needed for FSTPSS to control the power flow of the system. At present, the day-ahead energy management strategy (DAEMS) has been proposed to make an optimal plan for the whole-day operation of FSTPSS, but this energy management strategy does not consider the impact of real-time fluctuation caused by nondeterministic loads or sources on the reliable execution of DAEMS. To solve this problem, this article proposes an online energy management strategy (OEMS) based on long short-term memory (LSTM) network and deep deterministic policy gradient (DDPG) algorithm to counteract the effects of these real-time fluctuations. The proposed OEMS has the advantages of small tracking error, model-free control, and continuous action control. To verify these advantages, a series of comparative simulations is carried out, and the simulation results verify the advantages of the proposed OEMS.