The “gravy train” just derailed for this Long Island doctor.

Dr. Peter Lesniewski, 63, was sentenced Friday to eight years behind bars for being a top “lynchpin” in the Long Island Rail Road’s notorious $1 billion disability-fraud scheme.

Manhattan federal Judge Vincent Marrero at the sentencing also ordered Lesniewski liable for $70.6 million in restitution to the government – the same amount the feds say he bilked taxpayers by defrauding the Railroad Retirement Board.

Lesniewski, along with railroad retiree consultants Marie Baran and Joseph Rutigliano, were found guilty in August of mail fraud, wire fraud and health-care fraud by helping hundreds of LIRR employees receive sham disability payments by faking career-ending physical ailments. They were the first to head to trial.

The feds had asked the Marrero to sentence Lesniewski to anywhere from 11 years and three months to 14 years in prison. Assistant US Attorney Daniel Tehrani called the disgraced doc one of two key “lynchpins,” along with Dr. Peter Ajemian, in the massive scheme.

But Lesniewki’s lawyer, Thomas Durki, tried to convince Marrero to sentence his client to only 30 months in prison, saying Lesniewski’s part in the fraud wasn’t as big as Ajemain’s and that he shouldn’t be penalized to fighting the charges.

Marrero, however, opted to sentence Lesniewski to eight years in prison – the same amount of time he handed out to Ajemain, who copped a plea to similar charges in January 2013.

Durkin afterwards said he’d appeal the judge’s sentencing ruling.

Prosecutors say Lesniewski and Ajemain were the “go-to” doctors whom workers sought out to falsely certify disabilities. Both regularly created a “paper trail” of needless medical appointments and tests and then charged the cheaters $800 to $1,000 a pop for phony “narratives” of their purported disabilities, the feds say.

Thirty-two doctors, consultants and retirees have been convicted in the LIRR case. The feds say the scheme extends back to the late 1990s and involved hundreds of people.

Rutigliano in December was also sentenced to eight years in prison. Baran has yet to be sentenced.