I know its not Westworld and tired of getting that on google. its set when all humans are long dead or at least very rare. the main character is like a hired gunfighter who arrives in a town of other androids that just had a fight and a headless android gets the gunfighter to attach his head to another headless droid. the story revolves around a gang terrorizing the town and the gunfighter was hired to stop them.
By any chance is it Omega Doom?
It's the only dystopian future robot cowboy movie I can remember.
There's definetly a character that is simply a robot head, and a city/town of andriods/robot people.