speaking of mechanical injection only right now...like on older tractors (pre tier 4).
when you run out of fuel the fuel lift pump forces air into the injection pump, then the injection pump pumps air into the lines and injector nozzles, then the engine blubbers a few times and dies. So what you would do at that point is to refill the fuel tank and loosen the bleeder screw. Most all Kubota mechanically injected engines will have a bleeder of some sort, typically on the injection pump's inlet or at least very near it. When the bleeder is loose, it allows air to be expelled, which allows fuel to be drawn into the lift pump, then pumped from lift pump to injector pump, then the injection pump picks up a little fuel and forces it at high pressure through the injector lines and finally to/through the nozzles. Once fuel is into the nozzles, it doesn't take long for the engine to start running again.
Some tractors are a real bear to bleed! I can think of a couple, and one being L2350/L2500/L2600/L3000. Run one of them out of fuel and you gotta jump through hoops to get them started again, so the best thing is to not run them out of fuel. Easy enough?
Tier 4 engines are almost all common rail injected, like most all newer diesel trucks are.. Anyway, the way to bleed those (kubota) is to loosen the little bleeder on top of the fuel filter housing, turn the key on but do not crank the engine. Let fuel run out of the bleeder for a few seconds, letting the air stop flowing. Once no more air, tighten the screw back up, and leave the key on for a few minutes to circulate fuel through the system. That little electric pump also forces fuel into the fuel rail at very low pressure, enough to get most of the air out. Common rail isn't as sensitive to air in the system but it is extremely sensitive to dirt/water/gas/etc.
where I see screwups is guys loosening the injector lines at the pump. Don't do it. The delivery valves are all timed. When you attempt to loosen the lines that have been stuck on there for however many years, the delivery valve has a tendency to turn as well, and at the point if it does turn, you remove the pump from the engine & send it off for repair. That's why Kubota put a bleeder on them but people see this stupid stuff of loosening the lines on TV gold mining shows and think hey I'll do the same thing. Wrong. They do it wrong on TV too in a lot of cases.