Also to charge creditors that 'arrest' a ship the mooring fee for the port (since they're the ones demanding it stays there).
The ship, any unclaimed cargo, and any unclaimed containers, would then be fire-sold with the base price of the remaining debt for that ship and the condition that whoever buys them is then responsible for them. Any additional proceeds go first to lessening the unload fees (presumably already paid for by the cargo's owners in their transit fees) and finally back to the former owner of the ship.
I forgot to add: The nation receiving the cargo should have an economic stability interest in backing the loans to do this, but those receiving cargo obviously also need to be in on the underwriting of these efforts.
Second edit: It also becomes obvious to me that the equilibrium price for 'when is it bad enough to execute this' is when those who need to claim the cargo from the ship value what they're getting enough to bail out the price of selling the vessels for scrap.
I mean, if I pay $1,000 to ship my $30,000 car, what's stopping the port from saying they want $20,000 to give it to me?
As for the input costs, they'd probably (and should) enforce the standard market rate of processing fee.
The idea isn't that the company is bidding on the value of their cargo; it's that the companies FIRST get to declare if they're writing off their cargo or paying whatever their split of the loading fee is (possibly a maximum value they'd claim at) and THEN anything left is sold off (to get rid of it).
Should Business X pay to just unload their own containers? But containers are in large stacks on the ship; it is improbable that the containers they want are all on top. They'd have to unload at least some others to get the ones they want.
Should Business X join with all the other businesses that have containers on board? That might be the most equitable, but it's a huge coordination problem (their could be a thousand businesses), and it's still unjust - Business X (and all the others) had to pay for unloading on top of what they already paid Hanjin.
It might be better than the alternative (having your assembly line idled), but it's not an easy or cheap solution...