Unfortunately, things are much more complicated.
First, you should memorize, sea port is much more cargo capable than any sort of land transport.
To be exact, few Ukrainian sea ports, made more than TEN times more export/import in natural measures, than now working land transport facilities on EU border.
Second, Russian invade begins not in 2022, but much earlier - in 2014, but it is named "Anti-Terrorist operation", by Poroshenko government.
And during these years, Russia lot of times sent so named "humanitarian convoys", without Ukrainian and/or UN observers and border checks, even when constantly used railway to transport armored vehicles and weapons (so technically could send really peaceful convoys).
So, what Russia really want to do, to open large cargo port to steal Ukrainian goods and in other side, to transfer to Ukraine large quantities of weapons and military supply.
And to be honest, much number of sea mines placed by Ukrainian military, to make impossible Russian landing from sea, and second target is to make impossible to use sea ports to supply Russian military forces on Ukrainian territory.
So right answer with full truth - Ukrainian sea ports will open, when Russian military got away from Ukrainian territories, surrounding Ukrainian ports, and when Russian navy will move far enough from Ukrainian coast.
(So Ukraine will have full control over these ports)
Technically possible solution, to place UN forces, to control these territories, and to place military ships of countries non involved in conflict, to accept only humanitarian cargo.
But unfortunately, countries powerful enough to participate in these activities, avoid to do this, because Russia threatens to declare them side of conflict in such case. So I say, West avoid to declare war to Russia.
So at the moment, only possible solution, is to supply Ukrainians with modern western weapons, so Ukrainians will themselves release Ukrainian ports/coasts/territories from occupants.