Employee was operating a diesel locomotive on the outby end of a trip when they ran over a d-rail device causing them to d-rail and collide into the coal rib. Their right hand was caught between the locomotive body and rib. The result of the injury is amputation of the middle and ring fingers to the middle phalanges and amputation of the little finger to the distal phalange.