Representatives of local people's congresses gathered here today unanimously approved a unity agreement between Libya and Morocco, while reports from the Moroccan capital of Rabat said a nationwide plebiscite there, also held today, was expected to endorse overwhelmingly the union between the two vastly different nations.

Official results will be announced formally by the two countries Saturday. There is speculation here that King Hassan of Morocco may come here this weekend to join Libyan leader Muammar Qaddafi in celebrating the union and the 15th anniversary of Qaddafi's assumption of power.

Despite skepticism about the union in some circles in both countries, the voting today was expected to be unanimous or nearly so because of the strong attachment to the idea of Arab unity and government pressure to assure a positive result.

Known officially here as "the Arab-African Union Treaty," the agreement is expected to bring about a political rapprochement more than any real merger of institutions of the two countries, which are not adjacent and have vastly differing political systems.

Morocco is a conservative kingdom while Libya is one of the Arab world's most radical nations, formally known as a jamahiriyah, or "state of the masses." Furthermore, Morocco is a close ally of the United States and France, while Qaddafi regards Washington as his "No. 1 enemy" and Paris as his main rival for a dominant position in Chad.

Qaddafi's willingness to sign the treaty has also caused speculation that he has decided to come in from his diplomatic cold in the Arab world and Africa, moderate his policies and seek to shake off his terrorist image in the West.

Two of six British detainees held in Libya were released Friday in what the Libyian government said was a humanitarian gesture, Reuter reported. They were among Britons picked up in Tripoli after the siege of the Libyan embassy in London in April when a British policewoman was shot to death.

This apparent shift has been in the making ever since Qaddafi began overtures toward the Arab world's relative moderates in mid-1983 with surprise visits to King Fahd in Saudi Arabia and King Hussein in Jordan and a meeting with King Hassan.

Then, earlier this summer, King Hassan took the initiative in proposing and drafting the treaty, according to diplomatic sources here. The king, normally wary of the unpredictable and hostile Qaddafi, appears to have seized upon the Libyan leader's new mood and well-known interest in Arab unity schemes to win his support for Morocco's claim to sovereignty over the contested Western Sahara and backing for the controversial Moroccan position within the Organization of African Unity, where it has been a burning issue. In addition, the union agreement serves to isolate Algeria, one of the main supporters of the Polisario liberation movement in Western Sahara.

The unity agreement is Qaddafi's seventh attempt to merge with another Arab country since he came to power on Sept. 1, 1969. This one has provoked more attention than most of the others in the Arab world, Africa and the West because it represents a reversal of traditional alliances for both Soviet-backed Libya and Western-oriented Morocco and a radical change in Qaddafi's Arab and African policies.

The U.S. State Department has denounced the treaty as an attempt by Qaddafi to legitimize his rule and has expressed doubt that it represents a change toward moderation of his anti-American stance or and end to backing of terrorist activities.

France has shown even greater concern. French President Francois Mitterrand went to Morocco for talks with the king regarding the implications of the union for the French commitment to the besieged government in Chad, which Libya opposes, and the presence there of 3,000 French troops.

Meanwhile, Algeria has denounced the Libyan-Moroccan union, and Syrian President Hafez Assad has been here for talks with Qaddafi about its implications for the close relationship of their two countries.

The Libyan-Moroccan treaty reportedly involves a deal whereby Qaddafi will abandon his longtime support for the Polisario and apparently will recognize Morocco's claim to the territory.

Hassan, in turn, is reported to have agreed to recognize Libya's claim to sovereignty over the uranium-rich Aouzou strip in northern Chad. This would effectively support Qaddafi's 1975 occupation and de facto annexation of a strip of Chad 60 miles wide and 600 miles long.