They are good for infrequently used track and places where overhead wires would be in the way, like that very Tesla employee shuttle on it's own track and container ports.
It's not the best way to go for mainline track and not suitable for long distance high speed trains.
If it's infrequently used, a dual mode diesel-electric can fill that use case today.
Ireland is going to use a particularly unusual one for the Dublin-Belfast intercity route. It will have batteries, _and_ diesel generators, _and_ will run off overhead lines, in two voltages. The context is that parts of the line will take a while to electrify; it will initially run on overhead, battery, and diesel, then just overhead and battery as the lines are built out, and then hopefully finally just overhead.