Can you end a permanent war by liberating the city-state that declared it?
According to the Civ 5 wiki:
Liberating a City-State will immediately start an alliance with the liberator and give the liberator a lot of Influence (this will still decrease each turn, though, and by going under the limit, the alliance will then be cancelled).
This leads me to believe that regardless of the permanent war status of the other city states, a liberated city state should in theory ally with the liberator.
That being said, city-state total war is a unique situation, and I think the only way to truly know would be to test it yourself.