A UPS can work well as a surge protector as it is a common feature. You must compare the rating however. I had a nearby lightning strike that took out my router, 2x NIC and my UPS, however I purposely bought a cheap UPS that had loads of power but no significant surge protection (That is, I needed power on a budget and did not have the foresight to get adequate surge protection.)
Read up on the joule surge ratings, VA/Watt UPS ratings, and prices of the surge protectors and UPSs you can afford. The UPS is superior for the obvious reason of continuous power but will be much more expensive. Neither will protect you from a direct or very near lighting strike. I use a UPS for my computers and a quality surge protector for TV + Game consoles. Looking at my UPS log I had 13 power outages while the PC was on in the last 12 months, all but 2 lasted less than 1 second.