Well first, neither is a city. They're both quite small towns that you can walk all around in a half hour. So nothing is far in terms of 'train station or city center'.
Both are also as touristy as it gets. How you split the time really doesn't make much difference in my opinion, one is much the same as the other.
Given your stated interests (hiking) and dislike of 'cities', why did you pick them to begin with? While you can hike from both, you can't avoid the 'city' aspects of both.
Personally, as someone who also likes hiking and loves Switzerland, I would not stay in either. I can understand why someone would want to say ' been there' or 'seen the Matterhorn' but if what I really wanted was to enjoy some of the fine hiking available in Switzerland I wouldn't bother to pay Zermatt or St. Moritz prices just to stay somewhere that I don't particularly want to be in and of itself.
I'd stay in Tasch which is just down the valley from Zermatt and Sils Maria which is just down the valley from St. Moritz. If I felt the need to say 'been there' or 'seen that', I could do so easily but not need to actually stay in either Zermatt or St. Moritz.
Alternatively, I'd skip both and stay in somewhere like the Hasliberg for the entire time and do day hikes every day if I didn't feel the need to say, 'Zermatt, oh yeah, I've been there' but would rather instead say 'we did some great hikes in Switzerland, you have to see and hear the cow bells to really understand what the song, 'The hills are alive with the sound of music' really means.