A little sequence to show how we can use the crates and barrels at our advantage!
That's just an option among others.
In order to move crates and barrels you need a special skill, hopefully it is not too expensive.
You can push the object with the "open" button (by default spacebar), and pull it with the "secondary attack" of the hook (by default mouse right click).
In this case we first block the left path out without being noticed by the guards.
Then we use the second crate to block the right way. We push it enough so we have space for the barrel later. We go fetch and pull out the powder barrel, and we place it at the entrance of the block where the guards are. Once the guards are around we make the barrel explode with a pistol shot.
Finally we take possession of the treasure with a limited effort.