Freight trains frequently stop and block the roads of York, Ala., sometimes cutting off two neighborhoods for hours. Emergency services and health care workers can’t get in, and those trapped inside can’t get out.

“People’s livelihoods are in jeopardy because they can’t get to work on time,” said Amanda Brassfield, who has lived in one of the neighborhoods, Grant City, for 32 years and raised two daughters there. “It’s not fair.”

Residents have voiced these complaints for years to Norfolk Southern, which owns the tracks, and to regulators and members of Congress. But the problem has only gotten worse.

Freight trains frequently block roads nationwide, a phenomenon that local officials say has grown steadily worse in the last decade as railroads run longer trains and leave them parked on tracks at crossings. The blockages can turn school drop-offs into nightmares, starve local businesses of customers and prevent emergency services from reaching those in distress.

The problem has persisted despite numerous federal, state and local proposals and laws because the freight rail industry wields enormous political and legal power.

Courts have thrown out several state laws seeking to punish rail companies for blocking traffic, ruling that only the federal government can regulate railway crossings. No federal laws or rules penalize railways for blocking crossings, and congressional proposals to address the issue have failed to overcome opposition from the rail industry.

A bipartisan bill that was introduced in Congress in March, after a Norfolk Southern train derailed in East Palestine, Ohio, called for regulators to issue rules for trains carrying hazardous materials that would “reduce or eliminate blocked crossings.”

But that provision was stripped before the Senate commerce committee advanced the bill in May. The legislation, which awaits a vote by the full Senate, now would require only a National Academy of Sciences study on blocked crossings.

Rail lobbyists had argued that the provision was unrelated to the issues raised by the Ohio accident and pressed sympathetic senators to remove it, according to four people familiar with the negotiations over the bill.

Speaking on the day of the committee vote, Senator John Thune of South Dakota, the No. 2 Republican in the Senate and a former rail lobbyist, criticized the blocked crossing provision. “This bill should have been about safety reforms relevant to the derailment in East Palestine, but now it’s been expanded to a stalking horse for onerous regulatory mandates and union giveaways,” he said.

Senators who supported the provision agreed to take it out to gain more Republican support and bolster the bill’s chances, the four people said.

The freight rail industry is dominated by four U.S. companies — Norfolk Southern, Union Pacific, CSX and BNSF — and two Canadian ones, Canadian Pacific Kansas City and Canadian National. The U.S. railroads and the Association of American Railroads, a trade group, have spent about $454 million on federal lobbying over the past two decades, according to a New York Times analysis of federal lobbying disclosures. That is about $30 million more than the four largest airlines and their trade group.

Mr. Thune has received about $341,000 in campaign contributions since 2010 from railroad employees and political action committees, according to an analysis by OpenSecrets, which tracks money in politics. He served as the railroad director for South Dakota from 1991 to 1993 and worked as a lobbyist for several companies including the Dakota, Minnesota and Eastern Railroad for two years after a failed Senate bid in 2002, according to disclosure forms.

The senator declined to comment.

The Senate’s unwillingness to take on the rail industry was not surprising to Daniel Lipinski, a former House Democrat from Illinois.

In 2020, he introduced a bill that would have placed limits on how long rail companies could block crossings, and levied penalties for trains that exceeded those limits. The idea made it into a House infrastructure bill. But the Senate removed the provision after the Association of American Railroads said it would “lead to unintended consequences, including network congestion and reductions in service.”

“The state or local governments can’t do anything,” said Mr. Lipinski, now a consultant and a fellow at the University of Dallas and the Hoover Institution at Stanford University. “The federal government is not doing anything about the crossings, and that’s the way the railroads would like to keep it.”

The infrastructure law, which passed in 2021, did provide grants for “railroad crossing elimination” projects, primarily to put roads under or over tracks. Local officials said those grants would fix only a small number of crossings that freight trains frequently blocked.

There is no thorough accounting of how often trains block the country’s more than 200,000 rail crossings. People can make reports to a website maintained by the Federal Railroad Administration. There were 30,803 reports last year, up from 21,648 in 2021.

Texas, Ohio and Illinois had the most incidents. Some blockages may be reported more than once, but local officials contend that the database greatly undercounts blockages. York residents say they typically don’t report blocked crossings.

In a response to questions, the Association of American Railroads attributed blocked crossings to local governments, which, it said, had routed roads across railway tracks rather than over or under them, an approach that other industrialized countries had taken.

John Gray, a senior vice president at the association, said in a statement that railroads had taken steps to reduce the impact of blocked crossings. “The real solution is not a question of technology or operational practices by either the railroad or public agencies,” Mr. Gray said. “It is a public infrastructure investment similar to what has taken place in the rest of the developed world for more than a century and a half.”

Local officials and some railway employees said that explanation was self-serving. They link the rise in blocked crossings to a pursuit of bigger profits — Union Pacific, BNSF, CSX and Norfolk Southern have made $96 billion in profits in the last five years, 13 percent more than in the previous five years. The big railroads’ profit margins significantly exceed those of companies in most other industries.

In search of greater efficiency, railroads have been running longer trains. As a result, when those trains are moved, assembled and switched at rail yards, they often spill over into nearby neighborhoods, blocking roads, local officials and workers said.

Crews have a better sense of the space that shorter trains take up, said Randy Fannon Jr., a national vice president of the Brotherhood of Locomotive Engineers and Trainmen union, who also oversees its safety task force. Longer trains are more difficult to maneuver on single-track railroads. Such railroads have sections of track, or sidings, where trains can pull aside to allow other trains to pass, but those sections are not big enough for very long trains, Mr. Fannon said.

“If you’ve got two 5,000-foot trains or one 10,000-foot train, you cut your locomotive use in half and your train crew in half,” he said. “That’s all this is about — profit.”

In York, trains stop and block roads when they use a siding that runs through the town. Residents say the company could move the siding into the surrounding countryside. The railroad association has listed new sidings as a way to tackle blocked crossings in its own materials.

“They have no incentive” to make that change, said Willie Lake, York’s mayor and a former federal bank regulator.

Connor Spielmaker, a Norfolk Southern spokesman, said in a statement that the company had worked with York to reduce the disruptions. When asked whether Norfolk Southern could move the siding, he declined to comment, except to say the company already uses sidings outside the town and had created a position to work on problems like blocked crossings.

“The only way to eliminate stopping at a railroad crossing is to eliminate the crossing itself,” Mr. Spielmaker said. He noted that Norfolk Southern wrote a letter in February to the Transportation Department in support of a federal grant application by York to build an overpass and said it would collaborate with York on future grant applications.

In June, York learned that its applications for two federal grants had been rejected. “It’s a punch in the gut,” Mr. Lake said.

Officials at the Department of Transportation and the Federal Railroad Administration, one of the department’s agencies, declined to say whether they could issue rules penalizing railroads for blocking crossings. A spokesman for the railroad administration, Dan Griffin, said the railroads should fix the issue without being required to.

“The duration and prevalence of blocked railroad crossings are the result of a rail company’s operating practices,” he said in a statement.

The blockages are unrelenting in York — and sometimes extreme.

On a sweltering election day in June 2022, a train blockage lasted more than 10 hours, forcing many people, some old and ill, to shelter in an arts center.

Carolyn Turner, 51, said stopped trains had trapped her in her neighborhood several times, making her late for dialysis appointments 30 miles away and causing great stress. “I like to go there and get back and help out with my grandbabies,” she said.

The town’s population is mostly Black, and some residents said that might explain why its rail crossings were often blocked.

“If you really want to see them squirm, tell them: ‘How many white people’s communities do you do this in?’” Jessie V. Brown, an Army veteran, said about Norfolk Southern executives. The company declined to respond to Ms. Brown’s statement.

Some officials are pinning their hopes on the Supreme Court.

At least 37 states have laws regulating blocked crossings, some more than a century old, and courts have overturned several of them. Ohio, Indiana, Alabama and other states have asked the Supreme Court to affirm that they may set limits on blocked crossings. The court could decide this fall whether it will hear the case.

Kitty Bennett contributed research.