Symbolism, Imagery, Allegory
If you're not up on some of the big names in Greek/Roman history, then you will be once you've finished the Enquiry. Don't worry though, because this isn't a history lesson and we won't be giving a pop quiz on ancient civilization. Hume uses these examples because they help make a point.
Hume's reference to the Greek statesman Pericles is a great example. Hume explains that, when this guy was on his death-bed, his friends were listing his trophies and achievements. Pericles, however, reminded them: "no citizen has ever yet worne mourning on my account" (II.I.2). You see? We don't need to know all the background info on this guy (though feel free to read up if you want to). Hume just uses this example to show what's important in life.
Not all these historical figures are perfect moral citizens, with Hume giving us some examples that demonstrate vice. We see this when Hume refers to what Roman historian Livy had to say about Hannibal (no, not Lecter—the famous warrior). Hannibal certainly had his fair share of virtues: he was brave, tough, determined, and adored by his soldiers. However he was also cruel, disloyal, and downright inhuman. So, even these ancient heroes could have their faults.
Some of the guys that Hume references are warriors while others are writers, philosophers, or politicians. This means that the qualities that are most valued can vary: it's important for a warrior to be physically strong whereas, for a philosopher, mental abilities are more important. This demonstrates Hume's point that virtues and vice aren't always set in stone.
By painting a picture of these figures, Hume brings them to life and stops this from being just another dull philosophy text. Hume isn't just trying to wow us with his knowledge. His aim is to back up his argument and help us follow his line of thought.