Container ships are more efficient than trucks when measuring CO2 emissions, not so much by other emissions. The problem is that they use high sulfur "bunker oil" fuel. At least with trucks there is a clear path to electrification via renewable means; I don't know that there's a similar path for electrifying container ships due to the logistics involved.
https://en.wikipedia.org/wiki/Environmental_impact_of_shippi...