For hysterical raisins: Before the advent of power electronics, which allowed three phase asynchronous motors to proliferate, commutated series-wound motors were
the railway motor because of their beneficial characteristics (quoting Wikipedia: "high starting torque, can run at high speed, and are lightweight and compact").
A classic commutated series-wound motor is a DC machine. The problem with DC power is that without power electronics, you can't really change the voltage (except downwards by wasteful resistors), so your transmission voltage is limited by your maximum motor voltage and you incur relatively high transmission losses and need frequent substations every few kilometres. (Mainline railways can cheat a bit by equipping all of their rolling stock with two (or occasionally more) motors permanently linked together in series, so each motor only gets a fraction of the voltage, but you can take that approach only so far…)
So you want to switch to AC power, which is more efficient because it can be easily transformed up and then down again, because transformers can actually be made small enough to fit into a locomotive.
Fortunately with some adaptations a series-wound motor can be made to work on AC, too, but there are some trade-offs depending on the required amount of power and the frequency. I.e. the motor still works better if your AC current is more "DC-like", i.e. doesn't have too high a frequency.
It turns out that for something more modest like a hoover or a domestic power drill, an AC series-wound motor ("universal motor") will work fine enough even at 50 or 60 Hz, but for railway purposes with their somewhat higher power demands things didn't work so well.
Because at that time power electronics didn't exist or were still in their infancy (e.g. mercury arc rectifiers), there was no possibility of doing anything useful on board of the locomotive, so instead it was decided to reduce the frequency of the railway's power supply system, because at 16 2/3 or perhaps even 25 Hz motors could still be made to work reasonably enough.
Also at that time changing the frequency meant using a motor-generator set, and presumably choosing some simple integer ratio for the two frequencies also simplified things.
By the time other countries started considering switching to AC electrification, usable rectifiers existed that could be used on locomotives, so those countries could electrify at the full 50 or 60 Hz and then rectify the current to DC on board of the locomotive, thereby sidestepping the problems of running a commutated series-wound motor with AC power.
Even later on we then got fully variable voltage and frequency inverters, which finally allowed serious usage of (usually asynchronous) three-phase induction motors.
(Some railways used three-phase drives even before that, but without modern electronics this was a somewhat more cumbersome prospect, see e.g. https://en.wikipedia.org/wiki/K%C3%A1lm%C3%A1n_Kand%C3%B3)