Eight Massachusetts Bay Transportation Authority vehicles derailed in 2016, the nation’s highest overall figure and the second consecutive year the transit agency has had among the most light-rail derailments in the country, according to federal statistics.