Dual-mode locomotive