> But making renewable energy boats is very hard, whereas renewable energy trains is much easier
Nitpicking: the word "boat" is not used for anything big. For small vessels I've seen loads of areas where they need to be electric. So the statement "making renewable energy boats" is inaccurate if you use "boat" instead of "vessel".
Not everything is as nicely electrified as above map would suggest. There are tracks that aren't electrified while above map would suggest it is.
Still, this could be assumed to be solvable. You need a significant amount of (additional!) trains vs the amount of container vessels. Which means additional track. After all of that is done the cost of transport will be significantly higher. If there was a renewable solution for container vessels then you'd need to replace way less. I'm not too sure about the "much easier" assumption if you take everything into account.
A lot of container shipping companies are state owned (by e.g. China). Some aren't state-owned, though they've received a significant amount of state help in the past. See https://en.wikipedia.org/wiki/List_of_freight_ship_companies. France helped CMA CGM various times in the last ~10 years.
So although rail might be the best solution for the environment, I don't see it happening. The cost/price needs to be right, and if the cost is influenced artificially then a business/company might change things in ways that aren't expected, nor good for the environment.
In an ideal world any decision would be taken with the environment in mind. In practice it's quite difficult. Even if you follow this as a country, if you're not big enough other countries might undercut your economy, thereby minimizing the effort of just one country.
Various container shipping companies are ok with stricter regulations. But then they need to be checked and enforced. There's too much potential money to be made to ignore regulations. Note that captains of a vessel can be thrown in jail for various reasons, it's much stricter than financial industry (pay a fine and continue).
The cost is currently influenced artificially, people get to pollute without paying to clean it up. Tax everything the amount it costs to clean up the pollution it causes, only way.