Three states -- Illinois, Indiana and California -- are quickly approaching a federal deadline that will require them to help fund Amtrak operations or lose service in their states.

As part of a 2008 federal law, 19 states with Amtrak service are required to enter agreements to pick up most of its costs by this month. The policy was designed to give more equity and stability to Amtrak's funding stream.

Due to a hodgepodge of agreements, some Amtrak routes in the past have received robust state funding, while others were entirely funded by Amtrak. The new requirement would bring more consistency to the system.

The affected routes carry more than half of Amtrak's ridership. In 2012, Amtrak and states reached an agreement on a funding formula to determine what states owed the rail provider for each route. The change in policy applies to routes that are less than 750 miles long, and it doesn't affect Amtrak's popular Northeast Corridor route.

READ: Other articles about transportation and infrastructure

The change has been difficult for some states since historically they've lacked dedicated funding streams for Amtrak and instead relied on appropriations from general funds or other transportation accounts to help fund the rail provider -- if they provide any funding at all.

Indiana, for example, has to come up with about $3 million annually to preserve its four-day-a-week Hoosier Line service. Until now, it hasn't had to contribute anything for the Indianapolis-Chicago connection.

In recent days Amtrak has sent notices to states warning that the trains could stop running Oct. 16 if they don't reach the necessary agreements. "Time is running out," Amtrak spokesman Steve Kulm says. "We're working diligently with the remaining states."

On Thursday morning, state transportation officials in New York announced it had become the latest state to reach an agreement with Amtrak.

“This agreement represents a significant state investment in rail service, which thousands of travelers and businesses rely on each day to help keep New Yorkers moving," New York State Department of Transportation Commissioner Joan McDonald said in a statement.

Under the terms of that deal, New York state will pay $22 million in FY 2014 to cover costs associated with four routes as part of its "Section 209" agreement with Amtrak, a reference to the part of federal law that requires the cost-sharing deals.

Ross Capon, president and CEO of the National Association of Railroad Passengers, which advocates for rail service, said he was optimistic that the remaining states would reach agreements as well.

He said part of the reason it's taken so long to reach deals may be political, since state officials want the political cover to say "we fought as long as we could and this is the best deal we could get."

Collectively, states will be paying about $85 million extra annually to preserve service, Amtrak spokesman Steve Kulm said. On average, Amtrak would continue to fund 12 to 13 percent of the cost of those affected routes.

Kulm said Amtrak is "very close" to reaching an agreement with Illinois.

In California, Amtrak needs to sign deals with two agencies: the state transportation department , as well as the Capitol Corridor Joint Powers Authority, a partnership of six local transit agencies. Amtrak has reached an agreement with the joint authority but is still working to reach one with the transportation department, Kulm says.

And in Indiana, a stopgap agreement might be necessary to preserve rail service while negotiations continue on a longer-term deal, state officials say.

Indiana leaders are working on a plan to pay for the state's contribution with a combination of state money and funds provided by localities served by the Hoosier Line. It's also continuing to negotiate with Amtrak at the same time it's working with cities and towns.

"We want to make sure the taxpayer money that's provided (has) accountability with where it's going and what it's being used for," says Will Wingfield, a spokesman for the Indiana Department of Transportation.

The current situation could foreshadow a fight over Amtrak's long-distance routes. Federal lawmakers will soon start debating the next rail bill, and House Republicans have criticized Amtrak's long-distance routes, which are not profitable, suggesting they may be in line for reforms.

A recent Brookings Institution paper suggested states should be required to become financial partners for those long-distance routes, similar to the current process for shorter routes already underway.

But rail advocates say politically that's unrealistic, since long-distance routes pass through multiple states and it would be hard to get so many different players to agree on anything. They also say eliminating long-distance routes could be risky to Amtrak's business, since it could disrupt the existing network.