Fighters et al. by design end up being super specialized, usually becuase it's "realistic".
I don't think realism is the only or maybe not even primary problem here. The problem is that the D&D Vancian spellcasting system lends itself to being highly extensible. If there is something left out of the design of spellcasters, it is easy enough to add it in a splat book later on, filling in some potential gap in spellcaster power, or creating greater synergy and the potential for optimization. No spell tends to create a limitation on any other spell, and no new spellcasting class tends to impinge on an existing class. To put it simply, Vancian magic tends to make spellcasters immune to all bad design except for being broken by making spells which are too good.
The same has not been true of the martial classes, and ultimately I think in D&D's case you have to blame this on a very long running series of bad design decisions. The martial classes are nerfed because no one has approached the question of how to design one properly well.
They will have to spend resources getting good at one style of fighting or one weapon or what have you.
That in itself isn't the problem. One of the biggest mistakes that has been usually made with regards to trying to balance the fighter with the spellcasters has been to look at the problem as being simply not making the fighter good enough at hitting things with a pointy stick. The truth is that the fighter has pretty much always hit things with a pointy stick well enough, and that no amount of giving him bigger sticks really fixes the problems.
The problem is that - even within the archetype of 'fighter' - there are a broad range of capabilities associated with the idea which instead of being seen as the proper business of 'fighters' instead have been silo'd off into an increasing number of variant classes. This problem has existed ever since classes like Cavalier and Barbarian became standard. Where once the Viking or the Knight were considered properly fighters, they then became properly Barbarians and Cavaliers. The reason for this was the realization that there was skills and abilities specific to each that weren't really part of what a fighter was specifically defined as being able to do. But rather than realizing that the fighter needed to be reengineered to have those sorts of options, they were moved out of the class. This process wasn't reversed until Feats came along in 3e, but by then there were new flaws in the design. And the same flawed philosophy continued into 4e, when classes like the Marshall or Warlord silo'd off the notion of a leader and commander away from the Fighter who had always held those notions but had never been allowed to capitalize on them mechanically.
The fundamental problem is similar to the problem posed to OD&D by the introduction of the Thief. The very fact that the thief could now pick locks, climb walls, and move silently seemed to imply that the fighter (or any other class) could not do those things. Previously they had been players choices dealt with in an ad hoc manner by the DM. But now they were removed from being choices at all, because the Thief had packed them up and walked away with them. Worse yet, the Thief wasn't even very good at them. It's not the that Thief was narrow, it's that the Thief made everything else more narrow. It's this space sharing and endless bifurcation that hurts the martial classes.
It's not the result of 'realism'. It's the result of trying to fix the balance by endless extension, rather than by addressing it at a core level.
If the Rogue spent 20 levels worth of skill points on opening locks there damn well better be a lock that only they can open...
The bigger problem is if the door is barred on the other side, 40 levels of open locks might be of no use. Worse yet, if the door is Wizard Locked 40 levels of open locks WILL be of no use. The problem lies not with the Open Locks skill or its utility, but the fact that spells predate the existance of the skill system. As such, a spell like Knock or Wizard Lock is written in a way that doesn't integrate with the skill system, rather it simply just DOES something usually with a 100% chance of success. This completely outclasses any sort of skill system. Back in 1e, there might have been an excuse, but the issue simply has never been addressed even when the tools were created that should have let it be addressed.
The rogues biggest problem has been that when skills were introduced, they were introduced in such a tentative, hesitant fashion, that they were always weak and overshadowed by preexisting spells. 3e in particular adds in skills in such a hestitant fearful way, like it is fearful the having skills might break game balance in some way, that almost no class really benefits from it.
From the fighter's perspective, the biggest problem is the underlying abstraction and simplicity of the combat system. D&D traditionally provided no concrete rules for tripping, pushing, grappling, parrying, dodging, feinting and so forth. This led to situations where such things were either not possible (because they weren't specifically allowed) or else, if a DM did allow them, they were done in an ad hoc manner (like picking a lock prior to the thief class). Instead of addressing this design flaw by ammending the core rules, it's always been easier to address it by extending the existing classes by giving them something new that they can buy - specialization, a manuever, a feat, a skill trick. But this meant that the classes scarce resources had to be spread over a wider and wider variaty of enhancements. This would never really address the problem.
The real solution in my opinion is to not focus on the class so much as the system in which it lives. Too many feats extend a class by adding a new manuever - even if it is something so simple a kindegardener in a playground tantrum might try - which effectively excludes anyone without the feat from trying the manuever. Too many feats serve to extend the skill system, restricting the skill system for those without the feat. Instead, the combat system should be extended, or the skill system extended, and the feat addressing skill in that area should simply make you better at something you already could attempt with slightly less proficiency. 3e started in this direction, but it was far too hesitant in its implementation, fearing things that were new while trusting too much things that were old.
In 3e terms, feats and skills are the mundane classes resources. The problem isn't merely that the classes need better access to these (though that doesn't hurt), but that feats and skills need to be brought up to compete more with spells. The heal skill might need to allow the possibility of actual healing, for example, without the need for a feat that extends the skill. Skills need to serve as something you can actively choose to do (like Tumble) rather than solely as something you can use to overcome a passive hurdle (like a Knowledge check). Feats need to progess in power and perhaps sometimes do more than we currently associate with feats.
And spells need to be rewritten to interact with the skill system in less absolute ways. For example, in my game 'knock' essentially lets you make an open lock check at a distance using a skill more favorable to the spellcaster than 'open lock' would be. It's superior in several ways to a mundane application of skill, but sense using it spends resources it doesn't replace the mundane application (which for example, since it doesn't spend resources, allows you to take 20). Wizard Lock does the opposite, making attempts to open the door by other means much more difficult (harder to force, harder to pick, etc.) But an 'epic' (high level) thief could be expected to possibly 'pick' a Wizard Locked door cast by a lesser wizard, because such a 'lock' just makes his door more secure rather than perfectly secure (except to another wizard) as it traditionally did.
The over specialization of the mundane classes didn't occur as the result of realism. It occurred as a result of failure to rectify bad design, which resulted in more bad design.