CAIRO—Libya’s two rival governments will begin debating on Tuesday whether to accept a final version of a United Nations-brokered peace agreement that the organization has described as the last chance to maintain a unified country.

The framework deal seeks to form a unity government comprising officials from both parties and caps a nearly yearlong process to decide how power will be shared in Libya, four years after the ousting of longtime dictatorMoammar Gadhafi left the country with no functioning political system.

Late...