Union Pacific and BNSF each had networks of predecessor railroad branches to reach the various LA Basin ports. The lines were low speed, indirect, mostly unsignalled and laden with level crossings. These lines were suffering from severe road and rail congestion by the time the Alameda Corridor opened.
There's a lot of issues impacting LA intermodal imports, not just the China/US trade war. The widening of the Panama Canal has allowed a lot of intermodal to move directly to Texas and the East Coast via ship instead of rail. To the north Canadian Ports with shorter shipping routes from Asia and shorter rail routes to Chicago have also seen signifcant growth in just a few years, which has impacted traditional intermodal rail routes in the United States.