In BattleMaster, they're pretty much just different flavour.
In the actual medieval period, they were indicators of rank, status, and power. No Baron would dare to anger an Earl, but no Viscount would be caught speaking ill of a Duke.
Of course, the particular titles used and their precise meaning varied widely through the time and space that we collectively call "Medieval Europe," so it's hard to make a definitive statement about what any given title "meant."