Fierce competition between ports may trigger substantial issues including port congestion, further wreaking havoc on the system resilience of ports. The coordinated integration of ports becomes a feasible and indispensable strategy for mitigating competitive pressure and enhancing the system resilience. In a two-tier supply chain within trade activities between two adjacent ports, we discuss the competitive and cooperative strategy selections between ports by a bilateral bargaining game to investigate how to improve the system resilience of ports in coping with congestion. The results reveal that port cooperation has the advantage of improving throughput and the system resilience of ports by alleviating port congestion, but becomes more challenging as the advantageous port's bargaining power and competitive intensity increase. Although under the pressure of high freight rates, shipping companies are still willing to actively participate in and promote the coordinated integration of ports for a premium service provided by ports. From the overall shipping supply chain, port cooperation optimizes the entire operation of port system and promotes profits from the high system resilience, demonstrating a better environmental performance by dealing with congestion. In light of the conclusions, it is essential to vigorously establish a port-port alliance through coordinated contracts to tackle congestion and enhance resilience, thereby boosting competitiveness and ensuring profitability in the whole system of ports.