Perfect analysis.
Theoretically, government can step in. But then, they would be called "socialist".
As you have pointed out, the ones causing the crisis are profiting from that. They have no incentive to fix it. And ports are strategic for countries.
So maybe is time to regulate ports. For example, by making mandatory to have a minimum number of workers for container stored/received. So if you store thousand of containers, you'll be forced by government to hire more people. Also, limit the number of containers they can store by meter. Increase the number of canes, etc.
On the other hand, private companies whose business would be impacted, might want to create their own logistic companies/divisions so they remain competitive. I mean, if outsourcing logistics doesn't work, you would need to take matters on your own hands.