Down near the floor under the water you'll find an exit which you'll need to follow. Cross the bridge and jump down into the water on the other side. Swim down and open the lock to release the barrels, which will float up to the surface, forming a makeshift bridge.
Once in the water, you'll see three barrels which are tied down. Either leap off before it jumps the track, or ride it into the water pit.