The main thing to remember about U.S. marshals is that they are part of the Federal government or agency. Their main job is to escort prisoners to another destination. This means that they’d made take one prisoner and transport them across state lines to another state in order to go to court about a crime that they committed in that state. So the Federal government is over the U.S. marshals.
The best way to remember this is that most Federal agencies have a job that maybe around the country. If the job entails the official going either around the country or across state lines then they most likely work for the Federal government or the Federal Agencies. The U.S. Marshalls may conduct business with different levels of the government.