The route length isn't important, only the longest distance between ports that you can recharge at. Cargo ships regularly slow steam (I.e. run the engine slow to improve fuel-efficiency) and stopping to recharge batteries at multiple ports to reduce the batteries needed is the exact same concept - sacrificing speed to improve fuel costs.
Shanghai to LA is probably the worst example (since the pacific ocean is basically the emptiest spot on the planet, as land/port frequency goes), but Hawaii still exists and they could recharge there.