I've always found a bit of confusion with the two terms - the research i've found is that in some places, the two terms were used interchangeably, which would also cause some problems when dealing with Federal Marshals.
If I recall, it's just the title that uses 'Marshal', and 'Sheriff' in the rest of it, but i'll have a look through and make any changes.
In mediaeval England where the title originated, the Sheriff was an agent of the monarchy though not a member of nobility. Probably filled a space created by the evolution of the bourgeoisie social classes (non-aristocratic land owners for example). Previously aristocratic rank defined both wealth and legal authority.
I think within the Holy Roman Empire a Sheriff was an agent of the Church (ie. the Inquisitorium). In fact you might consider generally a Sheriff as an agent of the Church, as under the English system the monarch is the head of the Church instead of a Pope.
To generalise in practise, compared to the US system a Sheriff would fall somewhere between a Federal Marshal and town Sheriff, since typically they were responsible for the King's interests (ie. rule of law) within their home town, whilst aristocrats ruled from forts and were more concerned with their own interests.