Undated (AP) _ A judge today found striking Philadelphia sanitation workers in contempt for defying a back-to-work order and warned them they could be fired, while Detroit officials' request that 7,000 striking workers there be ordered to return to their jobs was denied.

And in Pittsburgh, union officials said a strike by the city's 264 garbage workers was a good possibility if no settlement is reached when the current extension of their contract expires at midnight Monday.

In Philadelphia, Judge Edward Blake said he will fine District Council 33 of the American Federation of State, County and Municipal Employees $40,000 a day beginning Monday for each day the workers do not report.

The judge also warned the union of the city's right to fire, suspend or demote workers found in contempt.

''I certainly hope the officers of the union realize this is a serious matter,'' he said.

Mayor W. Wilson Goode had earlier threatened to fire any worker found in contempt and refusing to work. ''Tell them to try me,'' Goode told reporters Thursday.

Attorneys for the city said virtually none of the sanitation workers returned to work on Thursday and only 48 reported this morning, despite the order issued by Blake on Wednesday to clear the 40,000 tons of trash that has piled up since July 1. The judge had cited a threat to public health and safety.

Blake today also ordered pickets to stay a half-mile from city sanitation sites and emergency dumps.

The judge, rejecting a union request that the officers not be held in contempt, said ''it would just be unbelievable'' that the leadership did not instruct the rank and file to defy his order.

Union attorney Louis Wilderman had asked the judge for ''some time to cool off'' before imposing any fines or other penalties. Otherwise, he said, ''I think you would be pouring gasoline on the fire.''

''I hope that leaves ample room for communication and negotiation with members of the union,'' Blake said in holding off fines until Monday.

City Solicitor Handsel Minyard had said a contempt citation would be intended primarily for union officers.

About 12,000 members of District Councils 33 and 47 of the American Federation of State, County and Municipal Employees walked out July 1 in the nation's fifth-largest city over wages and benefits. Some 2,400 are sanitation workers, whose average salary is $16,070, according to city personnel director Orville W. Jones.

District Council 47 ratified its contract Saturday, but some members have stayed off the job in sympathy.

In Detroit, the strike by 7,000 workers, including clerks, garbage collectors, mechanics and others, has halted bus service for 200,000 commuters since Wednesday. Garbage has begun mounting up in the streets at a rate estimated at 5 million pounds daily, the zoo has been closed and water and sewer services may be affected if the strike drags on, city officials warned.

After denying an immediate back-to-work order Thursday, Wayne County Circuit Judge Sharon Finch today refused to order all strikers to return to their jobs. But she continued the proceeding this morning to hear arguments on the city's request that essential workers be ordered back because the strike is illegal.

Essential workers would include water department chemists, emergency telephone operators, garbage truck drivers and maintenance workers, certain police record-keepers, food inspectors, rodent control workers and election employees who had been preparing for the Aug. 5 state primary, said Robert Berg, spokesman for Mayor Coleman Young.

Later in the hearing, city officials agreed that members of two unions representing chemists at city drinking water plants would be exempt from any back-to-work order. The chemists had been working during the strike, but their lawyers wanted assurances of safe passage through picket lines to continue working.

Meanwhile, talks were scheduled to resume this afternoon after both sides met with a federal mediator for about two hours Thursday, the first bargaining session since the walkout in the nation's sixth-largest city began at midnight Tuesday, said AFSCME spokesman Phil Sparks.

AFSCME is the largest union among Detroit's 18,000 public employees.

''As mayor of this city, I will take all steps necessary to maintain essential city services,'' Young said. ''I will not allow AFSCME or any other entity to hold the health and safety of the city in hostage at the collective bargaining table.''

AFSCME is seeking a 26 percent pay increase over three years. The city has offered 2 percent the first year with future increases based on the city's financial health.

The average city worker earns about $16,000 per year, said AFSCME negotiator Flora Walker. She said most city workers make between $15,000 and $21,000 per year.

In Pittsburgh, negotiators for the city and Teamsters Local 609 are to meet Monday, union spokesman Curtis Casey said Thursday.

The contract has been extended several times since it expired in December, and the union ''is not looking for another extension,'' he said. ''We're looking at some kind of strike if the city doesn't come up with some agreement that we can live with.''

But Mayor Richard S. Caliguiri said, ''I don't look for any strike here.''

Casey said the union has agreed to a wage freeze, but is opposed to a city plan to reduce crews from three to two workers per truck. The union claims the garbage trucks' brakes are unsound and a worker is needed in the cab at all times.

Bernard Schneider, the city's labor relations chief, said he knew nothing of a strike threat and that the city has alternate plans if a walkout occurs.

''I am willing to extend the contract until we have an agreement or until I believe further talks will be fruitless,'' Schneider said.