That's really just speculation. The Galaxy class was used both for exploration and for war. Same with the Sovereign. Heck, even the original TOS Constitution class was used both for exploration and for wargames. There has really never been any correlation between a ship's class and its mission. The Miranda, for example, was used as a warship, a scout ship, a supply ship, and a science vessel.
Yes, it's speculation.
I do believe that the ships being used for war isn't necessarily related to the intended role of the vessel, but rather as a symptom of Starfleet's fairly strong stance that it's not a military, but will begrudgingly act as one when it needs to. They don't really make ships with the express purpose of combat in general, and when they do they still kind of PR them a bit... like the Defiant being an "escort".
Just about every ship seems to have a secondary combat role when it absolutely has to have one.
Also, the idea that one ship class replaced another is also on shaky ground, at least as far as what we see on screen is concerned. Logically, the Galaxy class should have replaced whatever the previous iteration of starship design that was in service before it. Otherwise, why design a new ship? Yet we see many more older vessels still in service than the newer ones.
I don't think it necessarily follows logic that a new ship design has to replace a previous ship design. It can just be... a new ship design. Even if it a new design IS a replacement for an older design, that also doesn't mean the older ships are just tossed in the garbage. I drive a car from 2014. There have been several new models to replace it since... they didn't just recall my car and tell me it has to go in the trash. I'm still driving it, despite a new option being available...
And if we go only by what see see on screen, then the Ambassador class was either:
a. A failure,
b. Not produced in mass numbers (which, quite frankly, the bulk of Starfleet's ship classes aren't),
c. Were produced in mass numbers but were all lost or destroyed in past wars or conflicts,
d. Were either produced in mass numbers or weren't, and were just fine but off screen on other missions and we just didn't see them.
If we're going with the idea that "a new ship has to replace an old ship", I would veer more into the failure category, just due to the Galaxy coming around so relatively quickly after the Ambassador, with those two ships clearly being in a similar lineage just through straight visuals. You could say the same of the Galaxy, although i'm not sure the Sovereign was ever a "replacement" for the Galaxy, rather it's a completely different design lineage. If anything, I could see the Sovereign being more in the lineage of the Excelsior.
I always linked the Sovereign to Excelsior over the Galaxy, and it's led me to think there was an unseen on screen "missing link" of an early/mid-2300's style step between.
I also don't think there's anything wrong with a ship not being produced in mass numbers and to be completely honest, it's probably that reason why we see so many Excelsiors, Mirandas, etc. I think you're entirely right that Starfleet tends NOT to mass produce any particular class of vessel. The exception to this was the late-2200's... they were apparently just churning out those ships.
It does make sense. It's clearly a fairly massive undertaking to completely overhaul/refit a ship, to the point that it might be more efficient to just build a new ship. Given how rapidly technology tends to advance in Star Trek, producing more limited runs of ships probably makes sense... design HighTechShip, build like 20 of them... and then in 5 years, they're old news and already behind the curve on technology, so design HighTechShipII, build like 20 of then, rinse and repeat.