I just got to the end of the borderlands 2 pirate dlc l. I killed the leviathan, but had to stop after treasure room. I came back to play but he was there dead and i was locked out of the treasure room and stuck in the leviatan lair.
Always see your map during such situations. I haven't been in that situation though, as xZOMBELIEVALBEx said, try checking the back of the arena.
Don't panic! It's a bit of a maze of a map setup, but you aren't locked out -- I promise. There's a pathway towards the back, head out that way. There will be small branch-off paths connected to it, but they just loop around back to the main path. Head straight and you'll find the exit gate. Good luck! Remember to always check your map. It's there to help you.