Long Island Rail Road workers hoping to game the system for massive disability payouts had a scam-friendly doctor on their side who made sure nearly all of them got their wish, a state auditor testified today.

Lesniewski, along with former LIRR union president Joseph Rutigliano and Marie Baran, a former railroad retirement board worker, are on trial for allegedly faking disabilities for hundreds of LIRR workers that bilked hundreds of millions in pension benefits.

Under questioning by prosecutor Justin Wettle, Marx also said that, of all the LIRR employees on disability, 83 percent of them had been treated by Lesniewski and two others, Dr. Peter Ajemian and Dr. Ralph Parisi.

Ajemian has already pleaded guilty in the case; Parisi has since died.

According to Marx, there were 126 other doctors available for LIRR employees to visit, but some of those physicians saw very few patients because the bulk went to Lesniewski, Parisi and Ajemian.

Marx also testified that 134 LIRR employees had “nearly identical language” in the narratives backing up their medical claims.