You sure had bad luck with both engines. I'm puzzled by the average mpg. Did you ever hand calculate? Could the EVIC average be incorrect?Here's a link to my truck:
Used 2017 Ram 1500 Big Horn 4D Crew Cab for sale - only $32,000. Visit Sam Leman Chrysler Jeep Dodge Ram FIAT Morton in Morton IL serving Pekin, Washington and East Peoria #1C6RR7LM3HS879473www.samlemanmorton.com
Have a look at pic #2...right there, average mpg: 19.8...that's my winter #'s.
For years, I've got the "Well...mine gets 38.957 mpg...you must be doing something wrong!!!" I ran stock fuel on a stock tune, had reg maint, replaced the fuel filter on time...drove the thing on the highway to/from work each day. It's not possible to have a lead foot in the thing, there's no reward for it. I ran a block heater, grille cover in the winter. What 'cha see is what 'cha get, boys, the thing never got a lick above 21mpg, ever. Replacing the engine didn't even make a difference. Perhaps it was the rear gearing? Who knows. Never used the truck for short trips, never used the thing for towing, drove it to/from places and used it for, well, a truck 10 or so times a year. 19-21mpg...
As for an aftermarket tune, would tuning the thing and removing all the EGR equip possibly extend the life of it? Who knows. Would it void the warranty? You bet. I would have loved to take the EGR and the DEF system off and replace the entire exhaust with a straight pipe...but again, not voiding the warranty on something I dropped $50K for.
I bought the thing to be a reliable vehicle that got better MPG than a 5.7L. I was willing to live with everything that comes with a diesel and went into the purchase with my eyes wide open...but my individual experience with the thing was that it got nowhere near posted MPG and the icing on the cake was having an engine dump-guts at under 30K of highway driving. I was never happy with the MPG, but at least it was better than the 12-13mpg my '14 got.
In the end, the engine popping out of nowhere was the nail in the coffin...I never trusted the thing a single day after that.