A hostage crisis in a bank in Beirut ended after the authorities agreed to grant a local gunman partial access to his frozen funds in exchange for releasing all six hostages.