Managing energy and emissions for rail operations