Virginia class nuclear subs cost $2.7B.
Submarines aren't normally used for bulk transport of civilian cargo.
The prototype NS Savannah cost $46M to build in 1955 (roughly $500B today) with half the cost being its nuclear engine. So, on the high end of modern container shipping, but with the benefits of rarely needing to refuel.
And that's before an economy of scale on bulk construction.
Wind power is path to decarbonizing shipping.
Sailing ships don't operate well at the scale we're building.