It's mostly about horsepower and torque.
Truck A 3.73 (gas same engine)
Truck B 4.10 (gas same engine)
Truck C 3.55 (diesel)
Here's hopefully an easy analogy. Ignoring the transmission picture the rear end ratios above as the same as riding a 10 speed bicycle. In a 10 speed you shift down to first gear and you pedal really fast yet go slow. You use 1st gear to start off and to go up a really steep hill. If you are in second gear you can start off a little slower but once moving you can go a little faster. You said the gas trucks are the same. So if you pretend the trucks above are bicycles:
Bicycle A (3.73 gas engine) is always in 2nd gear and has a rider with skinny legs.
Bicycle B (4.10 same gas engine) is always in first gear and has the same rider with the same skinny legs.
Bicycle C (3.55 and a diesel engine) is always in third gear but has a professional (think Tour de France) rider on it.
Ignoring bicycle C (diesel) for a minute:
Rider B stuck in first gear(4.10), can pull more weight than rider A because it's easier to pedal and power the rear wheel. Of course once up to speed rider B has to pedal faster and use more energy to maintain the same speed as rider A who is stuck in 2nd gear (3.73).
Now picture Tour de France rider C (3.55). Rider C is always in third gear. You would think that rider C would pull the least amount of wight because it's harder to get started from a stop. But rider C (diesel truck) has more torque (powerful legs) than rider A or B. So while rider C is stuck in third gear, his strong legs easily overcome the starting resistance despite being stuck in third gear and he can pull more weight than A or B.
So:
Rider C (Tour de France, diesel engine) even at 3.55 (third gear) can pull the most weight.
Rider B in 1st gear (4.10 skinny legs, gas engine) can pull the second higher weight but has to pedal faster burning more energy (fuel).
Rider A in 2nd gear (3.73 , skinny legs) can pull the least weight, but pedals a bit slower than B so uses less energy (fuel) to maintain the same speed.