Depends----------- If the Amtrak train can limp to a location of an available loco then the Amtrak crew prepares the freight loco ( disconnecting starting etc) . The Amtrak crew will then move loco to head end of train with dispatcher's permission and if necessary tow the broken loco to a designated spot if it was unable to continue. Then after permanent connection to Amtrak train make brake check and then off to the races.
If train stalled and a passing freight can loan a loco then crews work together to do whatever needed to put a freight loco on front of Amtrak see above.
A freight crew might need to be called to grab a loco and ferry that loco to a stalled Amtrak train. Once freight loco attached and whatever necessary is done then Amtrak crew move the train. Note it will almost always be an Amtrak engineer to operate HEP in trailing Amtrak loco. One time I was in that situation and the Amtrak engineer was dead on law (HOS) and he rode the Amtrak loco while freight engineer ran loco after Amtrak set up the brake system.