If your unit has the same fuel tank as my JD4300 I would bet that you have something foreign in the fuel tank. When you head uphill it moves to the rear and plugs the outlet. In my case it was pieces of silicone that had been used to replace a gasket in my storage tank hand pump.
Happened three times before I got them all out. Each time I had to siphon out the fuel and pull the outlet fitting. I only found the problem when the outlet got completely plugged and the tractor wouldn't run. Up until that point it only showed as a problem when driving uphill in forward. I could go up fine in reverse....