In the midst of the Philippines' economic and political problems, a prickly territorial dispute with Malaysia has resurfaced over its oil- producing state of Sabah.

A Philippine claim to the sparsely populated territory about the size of Ireland has long been an irritant in relations between Manila and Kuala Lumpur, but it seemed to lie dormant in recent years.

However, the issue inexplicably resurfaced last month when regional and other leaders gathered in the tiny sultanate of Brunei for celebrations marking its complete independence from Britain this year.

Philippine President Ferdinand Marcos said after meeting Malaysian Prime Minister Mahathir Mohamad in Brunei that the Sabah issue would be taken up with Malaysia after legislative elections in the Philippines in May.

Marcos also said he proposed holding a summit meeting in Manila of the Association of Southeast Asian Nations (ASEAN), which includes the Philippines, Malaysia, Indonesia, Thailand, Singapore and Brunei. He said the summit's agenda would include settling the issue of Sabah, a hilly expanse of dense tropical forest on the northern tip of Borneo containing just over 1 million people.

Sabah accounts for about 23 percent of Malaysia's total crude oil production of 440,000 barrels a day, which is projected to bring in $3.7 billion in export revenues this year. Sabah also produces rubber, Malaysia's third leading export with total 1984 earnings projected at $1.87 billion.

In Kuala Lumpur, the plain-spoken Mahathir bluntly denied telling Marcos that Malaysia would discuss the Sabah claim after the Philippine elections and ruled out any boundary negotiations until Manila formally dropped the claim.

Asked if he would go to Manila for talks on the issue, he replied, "Who, me? What for, a holiday?"

The issue is a touchy one because the Philippines clearly covets Sabah's offshore oil and complains that the territory is used by Moslem separatists from the southern Philippines as a sanctuary, training ground and logistical support base.

In addition, the Philippine government believes there are about 90,000 Philippine refugees in Sabah, many of them Moslems who fled intense fighting between government troops and Moslem rebels in the southern Philippines in the early 1970s. According to Manila, some of the refugees are members of a Moslem rebel group, the Moro National Liberation Front, and are being trained in camps in Sabah.

Malaysia denies giving any help to the Philippine rebels.

In an interview here, Prime Minister Mahathir said he did know why the Sabah question has come up now. He said that in Brunei, Marcos "brought up the matter of Sabah, and I had to explain our stand. There was no negotiation. It was just a statement of our stand that we expect them to drop their claim on Sabah."

He said a statement by Marcos at an ASEAN summit in Kuala Lumpur in 1977, pledging that the Philippine government was "taking steps" to renounce the long-standing claim, did not go far enough. Mahathir said Philippine statutes still define Sabah as part of the Philippines, and until these are changed by legislation or presidential decree, "You cannot say the claim has been legally dropped."

"A pronouncement by a leader may be refuted by a future leader," Mahathir said. "That is not good enough."

Neither, apparently, is a Philippine proposal to resolve the issue in a face-saving way through ratification of the Law of the Sea Treaty, which provides for demarcation of boundaries. Mahathir said exact boundaries could be worked out--a process currently going ahead with both Indonesia and Thailand--only after the claim is renounced.

However, outright renunciation of the claim appears to be politically difficult for Marcos, who does not want to give ammunition to nationalist critics at home.

Opposition columnist Maximo Soliven recently questioned what he said was the Marcos government's intention of dropping the claim.

While Malaysia and the Philippines disagree on historical details, the case essentially goes back to the late 1870s when the sultan of Jolo, now an island in the southern Philippines, ceded North Borneo to an Austrian baron, who transferred the territory to a British concern. The controversy stems from whether the sultan's transaction was a lease or a sale.

In any event, Sabah became a British protectorate in 1888 and was turned over, despite Philippine protests, to the newly independent Federation of Malaysia in 1963.

"We were snubbed completely, and even our 'friends' the Americans supported the British move," Soliven wrote. "Sure, we want friendship with Malaysia. We're all for unity in ASEAN. But at what cost?"