Locomotives last a long time. For a new locomotive going into service today, the range of low and zero fuel options available are likely to change far more rapidly that the locomotives can be replaced. So Rail Operations UK have ordered 10 new locomotives with not just 1 or 2 traction options but an amazing 3 options (overhead electrification, battery and/or diesel).
This provides not just great decarbonisation benefits but also great operational versatility.