So it's an inline 12volt boost pump? Interesting, those are often either part of the main pump or have a cam-driven lift pump. There may be a separate fuse for it as well, but if it runs for 20 minutes and then dies out it's probably not the fuse.
It's too bad there isn't a fuel pressure gauge between the injection pump inlet and the boost pump. Usually they need 10-20 psi to work properly, although they will operate with as little as 5 psi.
One other thing to look for is a kinked hose or pipe between the fuel tank and the injection pump, probably before the fuel gets to the boost pump. If there is a restriction in that line, it's possible for the boost pump to cavitate and put air in the injection pump over time, which will cause the engine to die out.
Ideally, one should remove the fuel line before it gets to the boost pump to check for unrestricted flow. I don't say it should spray fuel everywhere, but there should be a free flow from that line under gravity pressure. The filter will restrict it slightly, but not enough to starve the pump.
One thing we haven't mentioned is a restricted air vent. As the tractor uses fuel, air enters the tank to replace it, otherwise you'll have a vacuum in the fuel tank which won't allow any more fuel to flow to the pump. You said there was a leak in the top of the tank, so that might allow enough air in to vent the tank, but again it might not. Running under load for about 20 minutes then dying out sounds like the tank isn't venting properly. I've seen people put a plastic bag under the fuel cap to try and stop a leak. Result is no vent = no run after a bit.
To check the vent, it can get messy. One way is to fill the tank as much as possible, replace the cap as normal, then remove the fuel hose either before or after the filter. I'd recommend before the filter, since that way you remove the filter from the equation. Let the whole tank drain back into your fuel jug (it should be big enough to contain whatever is in the tank) If you get good flow for the first couple of minutes, then it peters out to barely a trickle (or acts like an air-locked pop bottle), then you have a vent issue. Remove the fuel tank cap and it should flow freely again. I think Kubota uses a vent device in the fuel cap itself, so if that's what's wrong, replacing the fuel cap is relatively cheap and easy. You will most likely have to bleed air from the fuel system when you're done checking this.
Some folk say to run the engine until it starts to die off, then loosen the fuel cap and the engine should pick up if the vent is the problem. That works better with a gas engine than a diesel, since there is often air entrained in the fuel flow if the pump is starving, so the engine may either not recover before stopping or takes a few minutes to clear the air.
Apparently some of the Kubota filters have a shut-off feature, that cuts off fuel flow when the filter bowl is removed. Mine is supposed to have it, but I haven't changed the filter yet so I can't say for sure. There might be a problem with that as well.
According to the manual I have... "When the fuel filter bowl has been removed, fuel stops flowing from the tank. If the fuel tank is almost full, however, the fuel will flow back from the fuel return pipe to the fuel filter. Before checking, make sure the fuel tank is less than half-full."
They recommend cleaning the old filter in kerosene, which I don't agree with. If the filter is dirty, replace it in my opinion. Less chance of contaminating the fuel system with dirt washed out of the filter.
From what you've told us, I think that fuel starvation is the problem, but the cause of it leaves a few choices yet.
Sean