NEW YORK — Patience wore thin over gas shortages, power failures, and long lines for everything from buses to food handouts on Friday, as many parts of the New York City region struggled to recover from the devastation left by Hurricane Sandy.
Mayor Michael R. Bloomberg decided Friday afternoon to cancel the New York City Marathon, scheduled for Sunday, amid a growing backlash from residents and local politicians angered at the intent of staging a race when many New Yorkers are still dealing with severe hardships.
‘‘While holding the race would not require diverting resources from the recovery effort, it is clear that it has become the source of controversy and division,’’ Bloomberg said in a statement. ‘‘We would not want a cloud to hang over the race or its participants, and so we have decided to cancel it.’’
On Staten Island, the borough that bore the brunt of the city’s casualties, rescuers pulled two bodies from a house in the hard-hit Midland Beach neighborhood on Friday afternoon. Neighbors who had been carrying ruined furniture and trash to the street watched as two body bags were carried out of a house on Olympia Boulevard, about two miles from the Verrazano-Narrows Bridge.
The victims, who were not immediately identified, brought to five the number of bodies found in Midland Beach, a low-lying area of bungalows and newer two-story houses that was hit hard by the surge that accompanied the storm.
The borough has become the epicenter of the devastation wrought in New York by the hurricane, which swept through the area after making landfall on Monday, as most of the more than 40 fatalities have occurred there.
And in a visible and welcome sign of recovery, lights began flickering in several Manhattan neighborhoods, including the East Village, the Lower East Side, and Chelsea.
Officials continued to emphasize their round-the-clock efforts, many by volunteers or employees whose own homes had been damaged, to restore normal life.
But people who were coping with a variety of problems were becoming exasperated.
Government officials have asked for patience. City departments tried to stave off the anger by opening help lines, handing out free meals, updating citizens with progress in restoring services, and monitoring Twitter feeds, where they answered residents directly about their individual commutes. Fees were waived for bus and subway travel.
Amid the continuing grief and hardship, Bloomberg announced Friday that the death toll in the city had risen to at least 41.
But there were some positive signs: New Jersey Transit started running partial rail service, more of the Metro-North Railroad system was back, and the Staten Island Ferry started up again. Bloomberg also said that a rule that required cars traveling into Manhattan on all tunnels and bridges, except the George Washington Bridge, to have at least three people would be lifted at 5 p.m. Friday.
Consolidated Edison, he said, hoped to have power restored to ‘‘most’’ of Manhattan by midnight Friday, although residents who live in boroughs served by overhead lines will have to wait ‘‘a lot longer’’ for power to return.
But perhaps mindful of the realities of disaster recovery, Governor Andrew M. Cuomo’s briefing was filled with encouraging updates along with expressions of caution. He said the city had made ‘‘great progress,’’ with service restored to about half of the 2 million customers who lost electricity during the storm.
Noting that progress in restoring power to Manhattan’s downtown area in particular would be a ‘‘big step forward’’ for transportation serving the area, he also hedged his remarks, noting it ‘‘did not mean that every light’’ would work.
Speaking about the shortages, including of gas, he said: ‘‘It is going to require some patience, it is not going to get better overnight, it is not going to be a one or two or three day situation. A little patience, a little compassion, a little understanding will make it better for everyone.’’
‘‘It has been a long week for everyone,’’ he added. ‘‘It is not over. There are still inconveniences but it could have been a lot, lot worse.’’
Gina Braddish, 27, had 4 feet of water flood her home in Long Beach, on Long Island, leaving a slick of oil, gasoline and raw sewage across her floors.
‘‘I have oil slicked on my floors and they tell me it’s not an emergency,’’ she said. ‘‘When the house blows up, then it’s an emergency. I just want someone to come down here and help.’’
As the week drew to a close, the widespread shortages disrupted some rescue and emergency services. The effort to secure enough gas for the region moved to the forefront of recovery work.
Cuomo said that as ports were reopened, the gas shortages should start to ease.
But local officials sprang into action in the meantime. The town of Belleville, in northern New Jersey, passed an ordinance rationing gas Thursday night that was reminiscent of the 1970s oil embargo. Starting Monday, and until the governor lifts the state of emergency, people whose license plates end in odd numbers can buy gas only on odd numbered dates, and those with even numbers on even numbered dates. The mayor of nearby Montclair suggested to the town council that it consider a similar plan.
In New Jersey, drivers waited in lines that ran hundreds of vehicles deep, requiring state troopers and local police officers to protect against exploding tempers. Some ran out of gas waiting.