As others have said, there are a number of ways that a region can remain at war when the parent country has moved on. If the attacking country was defeated or merged with another, for example, so can no longer declare truce, and nobody has enough interest in provincial issues to resolve the trifling war.
However, the problem is: how can the besieging city remain economically viable?
A siege requires supplies, either by raiding supplies from the surrounding land, or having good supply lines from the parent country. The former would not result in a happy stalemate, so either the parent country has a rationale to continue supplying them, or they have to be self-supporting without raiding.
How's about this, then:
Caertydyn is a major trading city and the main shipbuilding center of its nation, located a little in-land from the mouth of a river. The city isn't at the mouth of the river because the river delta was a treacherous, swampy morass of ever-shifting sandbanks and unstable footing. The only people who previously lived there were guides and river pilots who charged a fee to ships to help them navigate up through the delta.
Siege was set up to blockade the river and besiege the city. In creating the blockade, they dredged the waterways, cleared the river, sank pilings to set fortifications on and create a military encampment and harbour, and basically settled the river delta.
On cessation of hostilities between Caertydyn and Foreign Power, the army base at Siege was recognized by ForPow to be strategically necessary to maintain to prevent a retaliatory attack. So, they maintained it. To this day, it remains strategically expedient to maintain this military camp here, at the mouth of a major trade river.
Siege now taxes rivercraft entering the delta, but it's no more expensive than the pilots were, plus there's a ton more trade now that the river's properly maintained and with deeper draft. So it's self-supporting financially, is strategically important, and is also where the military corps of engineers is trained in waterway management.
Caertydyn remains very much under a de facto siege: no vessel or supplies can enter or leave it through the river, without the say-so of the military camp at Siege. Siege knows exactly what's entering and leaving the city, so can prevent the construction of warships that might be used to invade the parent kingdom.
However, Caertydyn benefits from the protection against pirates, the impressive waterway engineering that they lack the finances, equipment, materiel, and expertise to reproduce themselves if Siege were leveled as it would be if the military camp was removed. It would take years and heavy, nation-invading levels of investment to rebuild to anything close, and Caertydyn lacks that financial clout just to protect its trade routes.
Economically, it is strongly in Caertydyn's benefit to ensure that it remains in the Foreign Power's benefit to continue to besiege. But their other allies would never be OK with them signing any kind of treaty to permit the foreign power to officially establish a military encampment.
So they engage in saber-rattling any time the idea of raising the blockade is raised; beginning construction of a warship, perhaps, or closing their gates to people from Siege, or whatever... but backing down quickly as soon as it's clear that the siege has regained funding.
So economically and strategically, the two cities are now symbiotic, one providing military and engineering, the other providing commerce and sufficient threat to make the siege necessary.
TL:DR; have siege control the traffic (ie, besiege/blockade), but add value for Caertydyn. Have a military encampment at Siege be strategically useful enough to continue providing that value so that the existence of the military encampment will be tolerated. Have formal recognition of the encampment be politically inappropriate.