Ursula K. Le Guin
The place is Orsinia, a land of medieval keeps standing guard above walled cities, and of railways stretching across karsts to vanish in mountains where the old gods still live.