There is your flimsy excuse of why both factions suddenly have these ships.
And it's ridiculous!
Lex suggested that the Fed's and Klingons each confiscated those ships at theend of the war which would have made a million times more sense.... but oh well... dumb retcon story works as well...not!
This would make the most sense, even considering STO's own timeline about the relationship between Cardassia; the Federation; and the Klingons:
"In 2381, a coalition of planets led by Bajor demanded that members of the Cardassian government and military stand trial for crimes against sentient beings for actions taken during the Occupation of Bajor and the Dominion War.
The Cardassian government refused any request to surrender its citizens for prosecution, so the coalition appealed to the Federation Council and the Klingon High Council to join them in seeking justice for past crimes
"In addition to working to curb the rising hostilities between the Klingons and the Gorn, Federation diplomats were hard at work crafting a new pact between the Federation and the Cardassians.
On Stardate 63976.74, the Cardassians signed a new treaty, in which they agreed not to field a military or wage war. In exchange, the Federation agreed to provide aid to rebuild Cardassian cities and military protection in the event of an invasion of Cardassian space.
In response to the landmark agreement, the Bajoran coalition dropped its request to prosecute Cardassians for war crimes. Many among the Bajorans and Cardassians hoped that relations between their worlds would someday be normalized.