Because it wouldn't change the fact that McQueen, as an athlete, is getting older.
As far as I know, the notion of McQueen getting mechanical upgrades to keep pace with the new racers isn't directly addressed in the film, so the flippant answer (as already commented) is "because plot". However, I think it's possible to draw together a few reasons to also make a satisfactory in-universe explanation. But first, to address your supplementary question...
Could McQueen change his engine and still be McQueen?
And per this question and answer: yes. We see many instances of cars changing out minor mechanical components (particularly Lightning's working lights and many wheels) and it seems the engine would be no different. Notably in Cars 2 during the interrogation scene, the American spy Rod "Torque" Redline is unconcerned about replacing his engine block, and we also have the character of Sir Miles Axlerod who makes the claim to have replaced his internal combustion engine and driveline to be converted into an electric car. (Presumably all of the Allinol-fuelled WGP racers who were blown up during the events of Cars 2 would have needed new engines [or at least extensive repairs] too.)
Note that the "Community Service" clip you mention is from an earlier story concept during development of the first Cars movie, when Pixar were still trying to work out the 'rules' for this universe. It wasn't adopted for the final version of the story, so Lightning's consciousness couldn't be transferred to a steamroller body by an engine swap.
The linked answer establishes that cars comprise a living (as in organic) component, and a mechanical component. The mechanical parts can (presumably) be endlessly upgraded, but the organic part is posited to follow the same rules of aging and natural lifespan as humans.
In the Cars world, racers are athletes
I mean, race drivers and pilots are athletes in our world too, and their machinery is distinct from them. In Cars there's no distinction, so Pixar really played up the 'human' characteristics when they incepted their characters:
For the other race cars, we looked at how race cars drive. For McQueen, we looked at surfers and snowboarders and Michael Jordan, these truly great athletes and the beauty of how they move. You watch Jordan in his heyday against every other player, he’s playing a different game.
We wanted to have that same type of feeling, so that when they're talking about 'the rookie sensation,' you're seeing that he is really gifted. - James Ford Murphy
McQueen isn't special when he arrives in the Piston Cup because he's a newer, faster model, but because of his talent. The baseline vehicle statistics are treated more like the intrinsic physical characteristics that you or I or Usain Bolt were born with; they might give a relative advantage (as we see with the Next Generation in Cars 3) but it's training, talent and experience that makes them into truly effective competitors. (You may as well ask how a 1970's Superbird [Strip Weathers] and a 1980's stock car [Chick Hicks] can still compete on equal footing into the 2000's when McQueen shows up - they should be completely disparate in capability, but we handwave it away as experience and determination. It's a similar case in Planes.)
Note also that some emphasis is given to the "new training techniques" also employed by the Next Generation racers. Mostly this is played for laughs (like cars bumping around wearing VR headsets) but there is truth that the affordances of modern technology (like accurate data collection and analysis) has had a transformative effect on motor racing IRL.
Upgrades may be against the rules (or the spirit)
We don't know what the rules of racing in the Piston Cup are, other than they apparently don't follow that of the American stock car racing (Winston Cup) to which it bears superficial resemblance - which is a control series where power, aerodynamics, suspension geometry etc. is tightly controlled for parity. But we don't see any competitors running around with NOS (like the Delinquent Road hazards in Cars) or jet engines (Mater receives in Cars 2) so presumably some things are outlawed, or considered too cheap (and we do see one of Dusty's competitors in Planes get disqualified for using an illegal fuel!). Likewise modifying your intrinsic qualities (like engine power) might be viewed as akin to taking performance-enhancing drugs or procedures, to cheat your way to advantage. Note that when McQueen is repaired after his accident and Doc before him, they're brought back to the same shape and specification they were before - so whether it's dictated by rules or not, the characters in this world are choosing to inhabit their original forms and not fundamentally change them.
You mention Dusty getting tuned up. While it's true his rebuilt form looks substantially different (and the die-cast version is referred to as Supercharged Dusty), I'm not sure if he actually received any performance upgrades along with it (apart from a Sky Slicer Mk5 propellor, which is clearly allowed). While the bare-metal paint finish and new wings with tip tanks look wicked, at this stage of the story it was more a matter of patching him back together with parts donated by his competitors. Note, again, he ultimately wins through determination and tactics.
It's not what the story's about
The story has strong themes of adaptation and mentorship; staples of the "aging sports star":
Bob Peterson: We had told the first two acts of McQueen's life. In the first film, a rookie becomes a humbler racer. And although Cars 2 was a Mater film, it had McQueen at the top of his game. So we thought, "Well, why not go for the third act of any athlete's life? What happens when you start declining, and how do you redefine yourself?"
Mike Rich: I came on board in late 2014, and ironically it came at a time when a lot of iconic athletes — Derek Jeter, Kobe Bryant, and Jeff Gordon — were beginning to consider what they wanted to do next. They were confronted with what every athlete is confronted with at some point: When should I hang this up? When is the moment in which I need to be looking at what the next step is for me?
That was the thing that was so interesting to me — giving McQueen that challenge and obstacle that everybody faces: That you’re not getting any younger.
Every athlete has to come to terms with the fact that as they get older, their reflexes and body may not perform as well as they once did, or as well as the younger generation. But in the case of a car, the mechanical performance won't really decline if it's properly maintained. So I guess to make the Next Generation fulfill the 'competitive youth' archetype and credibly out-compete McQueen, Pixar went ham-fistedly with just making them flat-out better. The story then is how does Lightning deal with no longer being on top, and what and how does he choose to move on.