I sympathize with Bolivia.
The best solution would be to open a cooperation zone in the areas of Chile pointed out above that would give Bolivia unfettered access to the port and new infrastructure to connect the port to Bolivia. But still keep the port in Chilean hands. That way Bolivia gets the economic boost and Chile could also benefit from it since it would be in one of their coastal cities.
But nothing ever works out nicely like that. So... let the courts decide.
That was the arrangement. Bolivia has duty- and inspection-free access to the three northernmost Chilean ports (Arica, Iquique, and Antofagasta), but Chile also was supposed to have maintained a rail link from La Paz to the sea. Such a rail link was never completed.