NEW YORK — Rail commuters who endured days of hassles after this week’s train derailment made their way into Penn Station on Friday with assurances that track repairs were finished – just in time for the weekend, but not quite in time for the morning commute.

Amtrak, which owns and maintains tracks used by New Jersey Transit and the Long Island Rail Road, said at 7:30 a.m. that testing and inspections were completed. But NJ Transit said work was still being done and warned that delays were possible.

By that time, the Long Island Rail Road had already canceled 10 rush-hour trains into Manhattan and terminated four others at stations in Queens.

The derailment of an NJ Transit commuter train Monday as it approached the station platform ignited a spat between Amtrak and New Jersey Gov. Chris Christie, who angrily demanded a refund of money already paid by the state to Amtrak for maintenance and repairs.

The LIRR also unleashed its ire Friday, issuing a statement that said: “Because Amtrak crews did not finish track repair work by 4 a.m. as promised and because they did not grant access to tracks overnight so that Long Island Rail Road could pre-position trains, LIRR is forced to once again operate a reduced morning rush-hour schedule.”

The disruptions and delays to rail service up and down the Northeast apparently were caused by a weakening of the timber ties sitting under a piece of track in Penn Station. Monday’s derailment knocked out eight of 21 tracks maintained by Amtrak.

It was the second derailment at Penn Station in less than two weeks. On March 24, an outbound Amtrak train derailed and scraped against an inbound NJ Transit train.

The two derailments highlighted the challenges posed by Amtrak’s aging infrastructure and the myriad ways in which the system can go awry.

On Friday, New Jersey U.S. Sens. Bob Menendez and Cory Booker – both Democrats – sent a letter to their colleagues on the Subcommittee on Transportation, Housing and Urban Development urging them not to cut federal dollars for Amtrak.

The senators urged subcommittee members not to accept Republican President Trump’s proposed federal budget, which they say would drastically cut funding and support for Amtrak and jeopardize the $20 billion-plus Gateway project to build a new rail tunnel into New York from New Jersey and expand Penn Station to accommodate more trains.