Employee was using machine mounted re-trackers on a Brookeville locomotive due to the machine being off the track. The employee was operating the re-trackers from outside of the operator's deck of the machine. Once the locomotive was back on the track it rolled due to the brakes not being set catching the employee in a pinch point between the machine and the mine rib.