In my experience, that information is in error (a diesel only beating a gasoline engine by 1 or 2 mpg). A diesel pulling a heavy load will beat a gasoline engine by approximately 40 to 50 percent in fuel mileage, so a gasoline engine pulling a given load engine getting 10 mpg, will be beaten by a diesel pulling the same load getting approximately 14 to 15 mpg. Of course, the picture is complicated somewhat by the factor of fuel cost. Where I am, diesel fuel presently costs five percent more than gasoline. If you factor that in, the operational fuel cost advantage of diesel drops to approximately 40 percent, which is still substantially better than "1 or 2 miles per gallon." However, in some localities, the price differential may be slightly less or slightly more. The national average U.S. fuel prices as of 17 July 2017, showed that the average price difference of diesel fuel over gasoline was 4.14 percent.
Of course, the above discussion does not take into consideration that a diesel engine option typically costs thousands of dollars more than the standard gasoline engine that it is replacing. And the maintenance costs for a diesel engine are significantly higher. So unless you drive a lot of miles annually (in my opinion at least 15,000 miles or more annually), it's hard to justify a diesel engine on the purchase of a new vehicle. A few years ago I was about to purchase a new pickup, and considered getting a diesel. I ran the numbers on it and it looked like I would have to run the diesel truck to about 100,000 miles before I would break even. So I bought a truck with a gasoline engine.
Bill