DADE CITY — As the freight train chugged through town shortly after dawn Tuesday, crews looked at the ticking clock, stopped the train and walked away, leaving all 129 cars to block multiple intersections.

During the 90 minutes the 8,800-foot train sat on the tracks, bus drivers and parents scrambled to get kids to school on time. Police officers and sheriff's deputies abandoned their usual patrols to help drivers navigate a maze of side streets to the lone clear intersection south of town.

The stalled train angered city leaders, but it's perfectly legal. In fact, it's required for safety. Federal law limits crews to 12-hour shifts. When that time arrives, workers must stop the train.

"We refer to it as outlawing," said Augustine Ubaldi, a professional engineer and railroad expert for Robson Forensics. "They must stop the train until they are relieved by another crew."

A similar incident happened about a month ago in the small northeast Pasco community, with a train sitting like a wall for five hours, cutting off ambulance, fire and police access to neighborhoods on the city's east side.

Dade City Manager Bill Poe says he doesn't get why CSX can't anticipate the time limits and stop the trains so they don't block all the crossings in his small town.

"They should know when they are about to run out of hours and send another crew," he said. "This is a dispatch problem."

During last month's train stoppage, things turned chaotic as isolated residents began trying to get out. Some people even tried to climb over the train and were taken back to their homes by police working to control the scene.

Poe said that both times, no CSX representatives notified the city in advance. A heads-up would have been nice, he said.

CSX issued a statement Tuesday apologizing.

"CSX makes every effort to plan accordingly so that crews can change shifts on time and in areas that do not disrupt traffic," the statement said. "Sometimes that is not possible due to network congestion or traffic delays, and shifts expire while trains are en route. We are conducting a full analysis to determine what operational adjustments can be made going forward."

Ubaldi said other issues such as malfunctions, track repairs or even weather problems farther up the track can create a domino effect.

"Sometimes you break a knuckle and everything grinds to a halt," he said. "Then you run out of time and have to stop the train." He said in some cases it could take the company hours to find and send a qualified relief crew. Union rules also complicate matters.

Dade City isn't the only city battling the problems.

Two years ago in Columbia, S.C., a CSX line of coal cars blocked three downtown intersections for an hour during the morning rush, backing up traffic for miles.

The city of Benson, 125 miles west of the Minnesota Twin Cities, issued traffic tickets four times to BNSF Railway for violating a state law that prohibits trains from blocking intersections for more than 10 minutes.

The railroad, which argued that federal railroad rules conflict with state laws, didn't pay the nearly $1,200 in fines. The disagreement is being sorted out in court.

Inconvenience is bad, Dade City leaders say, but delays in emergency vehicle response times would be worse. Plus, the cars could be carrying hazardous freight.

"Do we really want hazardous materials sitting in our town?" Poe said.

Ubaldi said a city's best weapon is diplomacy.

"Invite them out to lunch," he said. "Ask for cooperation rather than being confrontational. Say 'We have these issues, what can we do,' and see if they can modify protocols to adapt to that."

Times researcher John Martin contributed to this report.