The Amtrak engineer who was driving a train that derailed in 2015 in Philadelphia, killing eight people and injuring more than 200, was charged Friday with involuntary manslaughter — after local officials declined to pursue a criminal case, and when victims’ families took advantage of an unusual Pennsylvania law that forced officials to act.

In that legal maneuver, it was the Pennsylvania attorney general’s office that brought the case against the train’s engineer, Brandon Bostian, who was also charged with causing or risking a catastrophe, and reckless endangerment. The charges were filed two years to the day after the fatal derailment.

Friday was thought to be the last day that Mr. Bostian, 34, could be charged with reckless endangerment before the statute of limitations expired.

As that deadline approached, the Philadelphia district attorney’s office on Tuesday closed its investigation and declined to press charges. In a statement, the office said that while Mr. Bostian was responsible for the derailment, “we cannot conclude that the evidence rises to the high level necessary to charge the engineer or anyone else with a criminal offense.”