Possible meanings are 1) the leaders of Jerusalem have used magic or sorcery to try to make an agreement with the gods of the place of the dead so that these gods would protect them from dying or 2) The leaders of Jerusalem were so confident that the Egyptians would protect that it was like they had made an agreement with the gods of the place of the dead.
Possible meanings are 1) the leaders trust in their own lies that they have said in order to protect themselves or 2) the leaders trust that the covenant they have made with the false gods of the place of the dead will keep them safe or 3) the leaders trust that the agreement they have made with the Egyptians will keep them safe.