Harmonic resonances are part of the power quality (PQ) problems of electrified railways and have serious consequences for the continuity of service and integrity of components in terms of overvoltage stress. The interaction between traction power stations (TPSs) and trains that causes line resonances is briefly reviewed, showing the dependence on infrastructure conditions. The objective is monitoring of resonance conditions at the onboard pantograph interface, which is new with respect to the approaches proposed in the literature and is equally applicable to TPS terminals. Voltage and current spectra, and derived impedance and power spectra, are analyzed, proposing a compact and efficient method based on short-time Fourier transform that is suitable for real-time implementation, possibly with the hardware available onboard for energy metering and harmonic interference monitoring. The methods are tested by sweeping long recordings taken at some European railways, covering cases of longer and shorter supply sections, with a range of resonance frequencies of about one decade. They give insight into the spectral behavior of resonances, their dependency on position and change over time, and the criteria needed to recognize genuine infrastructure resonances from rolling stock emissions.