To improve operational safety and system reliability, real-time wireless health monitoring systems are necessary for freight trains. However, due to the lack of onboard power and space restrictions, monitoring sensors rely on batteries as power sources, which are not eco-friendly and involve high maintenance costs for battery replacement. Therefore, developing self-powered maintenance-free wireless monitoring sensors integrated with energy harvesting is in urgent demand. Here, we propose a compact ultralow-frequency and broadband piezoelectric energy harvester (UBPEH) that can be easily installed in the limited space of the axle box to effectively harvest bogie lateral vibrations. The T-shaped UBPEH employs magnetic interaction to soften the stiffness and strengthen the stopper operation in a low frequency range. To predict and optimize the prototype, we establish the model of UBPEH by considering the displacement, inclination angle and shape of the magnets. Theoretical and experimental results show that the prototyped UBPEH might operate in the range of 1 - 11 Hz, covering the representative frequencies of bogie vibrations on freight trains. An output power of 605 μW on a matched resistance of 200 kΩ under the acceleration of 11 Hz and 0.5 g (g = 9.8 m s2) is achieved, and the harvested electric power can successfully drive typical commercial wireless Bluetooth sensors. Furthermore, the harvester possesses output stability and mechanical durability under actual service hours of freight trains. The results of this work pave the way to implement self-powered wireless condition monitoring on freight trains.