Virginia Railway Express will receive the bulk of its expected allocation from the state to cover the fees it pays to host rail lines, officials say, ending a two-month wait over millions of dollars VRE said it needed to continue to provide passenger rail service.

The glitch occurred with a change in how federal transportation dollars were delivered to Virginia and meant that $9.6 million in so-called track access fees — paid by VRE to CSX and Norfolk Southern rail lines — was held up in state coffers instead of being delivered to VRE.

However, in a letter passed on to VRE’s Operations Board members Wednesday, Thelma Drake, the director of the Virginia Department of Rail and Public Transportation, assured VRE that the bulk of the track access fees would be provided by the state.

VRE chief executive Doug Allen said in an e-mail to VRE’s leadership that he had been concerned about the uncertainty over the track access fees funding.

“Because of our required budget preparation schedule, we cannot adequately plan for the VRE system if we do not know until our budget has been set if we have a reliable funding source for one of our largest expenditures each year,” Allen wrote.

But now and in the future they can, because Gov. Robert F. McDonnell’s recommended budget includes language that would fund the fees with federal dollars, which Allen called “reliable funding.”

Without the funds, the passenger rail line, which takes about 20,000 passengers daily toward the District from lines starting in Manassas and Fredericksburg, would have been ill-equipped to deal with the shortage, officials said. VRE had laid out a series of possibilities to make up for the shortfall, including increased passenger fares or more taxpayer contributions through the local governments that make up VRE’s membership. All of the scenarios were viewed as severe and unpalatable by VRE’s leadership.

Prince William Supervisor W.S. Covington III (R-Brentsville), the chairman of the VRE Operations Board, said officials are continuing to push the General Assembly to assure the rail line that the funds will be delivered as promised every year.

“The state heard through a lot of parties about the value of VRE, and I think that made a difference,” he said of the resolution of the track fees issue. “Ideally, you’d like to not go through this gyration in the budget process.”

VRE officials will also push for a greater allocation of state and federal funding. Drake’s letter said the agency’s request for funding for next year could come up short by $680,000 to $720,000.

VRE generally adopts its budget in the spring. This April, VRE hiked passenger fares by 3 percent, primarily to pay for increased costs associated with contractors who run the day-to-day operations of the rail line and increased fuel costs.