Two-phase controlled compensator for alternating current quality improvement of electrified railway systems