The U.S. Postal Service and the nation's two largest postal unions reached tentative agreement yesterday on a 40-month contract that gives workers average wage increases of between $1,700 and $1,866 and restricts the use of part-time labor.

The agreement followed an around-the-clock bargaining session that lasted half a day past the 12:01 a.m. expiration of the old contract. The 579,000 workers affected by the agreement remained at work, and there was no disruption of service.

If an agreement had not been reached, the contract would have been resolved through a lengthy binding arbitration process. A federal law prohibits postal workers from striking.

Moe Biller, president of the American Postal Workers Union, and Vincent R. Sombrotto, president of the National Association of Letter Carriers, announced yesterday that the agreement calls for a series of wage increases totaling about 7 percent and 11 to 12 percent in cost-of-living increases through Nov. 20, 1990.

All workers would receive an immediate 2 percent salary increase. The contract also calls for increases of $250 in in July 1988 and January 1989, $300 in July 1989 and January 1990, and $200 in July 1990.

Biller and Sombrotto, who bargained jointly throughout the talks, said the settlement had been approved unanimously by top union officials and would be sent within a week to the 346,000 members of the postal workers' union and 233,000 members of the letter carriers' union for ratification. They said they expected the process to be complete in less than three weeks.

Postmaster General Preston R. Tisch said in a news conference, "We think it's a good contract for the United States Postal Service and the American people."

Biller said the agreement was good for the public and somewhat of a triumph for the unions. "We thought we deserved more, we wanted more, but it wasn't in the cards," he said. "We're happy."

The breakthrough apparently occurred just before midnight Monday when Postal Service negotiators dropped their insistence on an increase in the number of "casuals," or part-time workers who earn lower wages and are used during heavy mail seasons.

An earlier Postal Service proposal, issued early Sunday, had given the unions the opportunity to exchange higher wage increases for greater use of casual workers. The offer was designed to keep the Postal Service within its projected income, which assumes an increase in the cost of a first-class stamp from 22 to 25 cents.

The issue had emerged as a sticking point in the talks, with the unions charging that the Postal Service, through its use of part-time employes, was trying to establish a cut-rate work force.

"We told management we would never accept a second-class work force and we meant what we said," Sombrotto said. "We also demanded first-class wages for first class workers, and that's exactly what we achieved."

Sombrotto said the agreement also called for retention of an uncapped cost-of-living adjustment, expansion of job security protection to new categories of workers and improved safety and health protection.

Postal workers covered by the new agreement now are paid between $20,094 and $27,089 a year, excluding fringe benefits, according to the Postal Service.

Tisch said in his statement that the settlement is indicative of a new, cooperative relationship between the unions and management. "We learned from past mistakes and realized that we would accomplish little over the life of a new contract if we left the bargaining table in an atmosphere of contention and acrimony," Tisch said. "I believe we have risen above that and are ready to forge a new era in postal management-labor relations."

Biller was less optimistic about a new sense of good will, saying, "That has yet to be determined."

The agreement came nearly three months after talks began in April and ended a sometimes acrimonious final week of negotiations.