Can't find a clear answer who was more powerful
In any good Western, one of the obvious inclusions is a character taking the role as a lawman. If the story revolves around a town, this person is usually referred to as "sheriff". If you had walked up to a citizen in Wichita or Tombstone and asked for the sheriff, you'd be pointed to a man with a different set of duties and jurisdiction than what you'd expect from the movies.
Town marshal
When people think of a sheriff in the context of the Wild West, they are really thinking of a town marshal. This is the lawman responsible for the civil crimes in a town and his jurisdiction ends at the town limits. Although the popular conception of the 'town tamer' sheriff/lawman was mostly based on dime novels, the town marshal would be the individual responsible for keeping order in town. He'd be responsible for the town jail, for arrests and fines as well as more administrative duties such as collecting taxes. One duty you certainly don't see a lawman performing in the movies would be to keep the streets clean, not from bad men but from littering. A duty of the town marshal would be things like sweeping the sidewalk or dealing with stray dogs.
County sheriff
A step up from town marshal we find the county sheriff. As implied in the name, the jurisdiction of a county sheriff would be a particular county in a state. Just like the town marshal, the county sheriff would be responsible for civil crimes but stretched over a larger geographical area. A big difference between being a town marshal and a county sheriff was that being a county sheriff was an elected position. You had to run to be county sheriff, as opposed to town marshals that were appointed. Another difference between a town marshal and a county sheriff was in the topic of taxes. A county sheriff would also collect tax, the county tax, but would get to receive a portion of the taxes that they collected. This made county sheriff a very lucrative job and highly sought after.
Above both town marshal and county sheriff, you'd have a United States Marshal who would be responsible for federal crime as opposed to civil crimes.
That depends on what exactly you are meaning when you say Marshal. Before there were police departments as we know them you had individuals elected to a position known as a town marshal. They functioned as a police officer with jurisdiction over the town they were appointed to. They were also usually given the power to name their own deputies if they needed assistance. A sheriff would have jurisdiction over the county in which he was elected, and similarly had the power to name deputies. Sheriffs also in sometimes were the tax collectors and were able to keep some of the taxes collected. Above the both of them would be members of the United States Marshal Service. Which had a primary region they would take care of. Usually a couple of Marshals would be appointed for large states or territories.
Most of the actual work done for the Marshal Service was done by Deputy US Marshals, as the US Marshal was doing paperwork or other administrative tasks. For an example from Deadwood. We had Con Stapleton elected as Town Marshal in September 1876, then in March 1877 Seth Bullock was named Lawrence County Sheriff, and over all these was US Marshal James Burdick, Marshal for Dakota Territory.
Hope this clears things up, and if you want to read more about the US Marshal Service look up Bass Reeves. He was one of the best, if not the best, man the Marshal Service ever had, and he totally got forgotten in history because he was black.