We conduct three-dimensional direct numerical simulations to investigate the mixing, entrainment and energy budgets of gravity currents emerging from two-layer stratified locks. Depending on the density and layer thickness ratios, we find that either the upper layer or lower layer fluid can propagate faster, and that the density structure of the overall gravity current can range from strongly stratified to near-complete mixing. We furthermore observe that intermediate values of the density ratio can maximise mixing between the gravity current layers. Based on the vorticity budget, we propose a theoretical model for predicting the overall gravity current height, along with the front velocity of the two layers, for situations in which the lower layer moves faster than the upper layer. The model identifies the role of the height and thickness ratios in determining the velocity structure of the current, and it clarifies the dynamics of the ambient counter-current. A detailed analysis of the energy budget quantifies the conversion of potential into kinetic energy as a function of the governing parameters, along with the energy transfer between the different layers of the gravity current and the ambient fluid. Depending on the values of the density and layer thickness ratios, we find that the lower lock layer can gain or lose energy, whereas the upper layer always loses energy.