The latest generation of AC-fed traction drives, employing high-speed switching devices, is able to control the reactive power drawn by each locomotive or train from the overhead line. If the conditions at each train could be fed back to a central control point, it would be possible for a centrally located controller to calculate optimal values for the reactive power in each drive and to send these commands back to the individual equipments. A scheme is proposed whereby the AC power flows are analysed in real time and the results used to optimise some particular system objective via control of the PWM equipments as mobile reactive power compensators. The system voltage profile can be improved and the overall power factor at the feeder substation made nearer to unity. Computational verification is presented with results obtained from a multi-train simulator with the power network optimisation operating in several test case scenarios. The test results are compared with those obtained without compensation and with classical trackside Var compensation methods. The scheme is shown to give the best improvement where an existing fleet of diode or thyristor equipments is partially replaced with PWM front-end equipments. From these results, the potential for PWM locomotives to improve overall system performance is clearly confirmed.