Trains were operating close to schedule Monday night after fierce winds wreaked havoc on two LIRR branches, causing power outages that affected the signal system on the Ronkonkoma branch and the splintering of a utility pole that suspended trains on the Babylon branch, officials said.

Service between Seaford and Amityville on the Babylon branch resumed just before 9 p.m. after crews made temporary repairs to two 90-foot electrical transmission poles in Massapequa, according to the Long Island Rail Road and PSEG Long Island.

One pole had splintered about 4 p.m. and leaned dangerously, its weight dragging a second pole partially off its foundation, said Jeffrey Weir, spokesman for PSEG Long Island

As a result, trains were canceled and delayed on that branch, and officials said utility pole repairs could intrude on the morning commute.

The poles were stabilized Monday night by two bucket trucks, making the LIRR area safe for trains to go through, Weir said, and a crane arrived at night to help make permanent repairs.

Both poles will be replaced, he said, but it was unclear how long that would take and whether it would affect the morning rush hour.

advertisement | advertise on newsday

“We’re going to work through the night,” Weir said.

Not long after the winds damaged the poles, they also caused a power outage that affected the signal system on the Ronkonkoma branch, said LIRR spokeswoman Nancy Gamerman.

The commuter rail had reported eastbound delays of up to two hours east of Hicksville, while westbound service was suspended, the LIRR tweeted.

There were also signal system problems on the Port Jefferson branch and broken gates on the Long Beach and Port Washington branches earlier Monday, the LIRR said.

LIRR spokesman Aaron Donovan had said he knew specifically of two gates being broken on the Long Beach branch, as well as one near Pinelawn, another between Babylon and Bethpage, and another at Little Neck Parkway in Queens on the Port Washington branch, but he said there also are several others.

Most of the reports of gates being broken at their arms came before noon, “when the storm was at its worst,” Donovan said.

The first report of a broken gate came shortly after 11 a.m., when the railroad said the 10:14 a.m. from Penn Station to Ronkonkoma was delayed by crossing gate problems caused by the wind.

“Wind damage to crossing gates is not an uncommon occurrence,” Donovan said.

By about 8 p.m., LIRR tweeted, trains were on or close to schedule systemwide.