I don't quite follow your point,
Bb. Sam is cast in the role of servant, a Hobbit of lower "social standing" than Frodo and Pippin. That being the situation, does it not make perfect sense, within the context of Tolkien's portrayal of Shire society, that he should address them as "sir"?
Until relatively recent times (within my lifetime even), in England at least, it was quite common for public servants, shopkeepers and the like to address members of the public and their customers as "sir". Policeman still do (although more often than not with a hint of sarcasm
).