This next area leads into an arena with a fighting pit and a handful of guards. You'll need to charge into a few of them as Trico smashes them to pieces.
How to get the cart from behind the locked gate
There's a cog on the wall that Trico will paw at, raising the gates here a little and giving you a clue as to what to do next. Climb on top of Trico and give it the R1 + triangle command and it will open the gates for you.
Pull the cart out of the gate under the light from above, stand on the edge of it and command Trico to jump.
Trico will hit it and fling you up to the grill above.
Pull all three levers then go outside and call Trico who will jump up to join you. Take the right hand tunnel, go across the roof and from here Trico will jump up the waterfall.
How to make Trico swim
Head inside the cave here and feed Trico the barrel, then climb on and it will jump up into a room with a deep pool of water. Dive down and under the gate you'll find a waterlogged tunnel. Swim through it and climb the ladders to pull the lever and open the gate.
Call Trico down into the water. There's another tunnel at the very bottom of the pool, but you won't be able to swim to it on your own. Climb on Trico and and command it to jump and it will actually swim down, through a cave and up into another water-filled chamber.
There's another lever behind a gate on the right, and opposite is a gap in the cave. Climb the pillars and slip through the gap to find a barrel to feed Trico.
Now swim under the gate over to your left and you'll pop up just below a ledge that you can't reach.
When Trico gets back on dry land, command it to jump in and the wave will rise you up over the ledge, where you can pull the lever. This opens the small gate and a much bigger chamber below, so you'll need to get on Trico and command it to dive right down and swim through one last time.