Compared with the traditional overhead contact grid or third-rail power supply, energy storage trams equipped with lithium batteries have been developed rapidly because of their advantages of flexible railway laying and high regenerative braking energy utilization. However, trams may face expensive battery replacement costs due to battery degradation. Therefore, this paper proposes a multi-objective optimization method for the tram's driving strategy to reduce operational energy consumption and extend battery life. The method describes the optimization problem as second-order cone programming (SOCP). It uses the interior point algorithm for fast solving, thus obtaining the theoretical optimal speed trajectory in real-time. This feature enables the method to be applied online. To verify the effectiveness and robustness of the proposed method, we conducted simulations under actual operating conditions. The simulation results show that the proposed multi-objective optimization method can extend the battery life by 40 % compared to the single-objective optimization method for energy saving. As a result, the total cost of the whole life cycle is reduced by 6.54 %. Furthermore, this online optimization driving strategy method can effectively deal with unexpected conditions during the actual operation of the tram to ensure the secure operation, punctual arrival, and precise parking of trams. Finally, the effectiveness of the proposed method is further verified by a hardware-in-the-loop (HIL) test.