The choice between them depends on your priorities, both really are flagship-level devices.
If one of them is a lot cheaper than the other, it's probably the one to go for.
If the prices work out to about the same, then you just have to decide which things are the most important to you. Physically, the S5 is more "future proofed", since you can swap the battery and add SD memory to at least hold media and photos. Software-wise, the MotoX is going to be more "future proofed", since it will receive Android updates more quickly and for a lot longer (though Samsung replaces a lot of Android features with their own in TouchWiz, so that just depends on whether you like the way Sammy does their enhancements).
My Moto X 2013 has been an excellent phone in all but camera, screen size, and battery life. Camera and battery are average. Screen size was just too small for me. The Moto X 2014 has solved the screen size problem handily, camera has marginal improvements, and battery remains average. But I still love the quirky things that make the Moto X the Moto X.
I almost jumped at a Nexus 6, but decided that was just too big, and too expensive, for my needs. Plus it didn't have all the Moto X goodness on it like proper active notifications, twist-and-shoot, etc.
I still wonder whether I made the right choice. My wife doesn't worry about battery like I do, and I know if battery became a problem in the S5 she could get a spare or even get an extended-life battery. Her camera takes much better pictures in low light. She has an SD slot. All of these things would be useful to me as a heavy phone user.
So I'd say, overall, if you already have an S5 and are happy with it, the Moto X 2014 is probably not something I would call an "upgrade" from it unless you value a purer Android experience or one of the other things that makes the Moto X stand out - and those things are not going to be of value to everyone. In most ways, the Moto X is going to be a "downgrade" from the S5.