Authors need not resist temptation, which makes writing stories so uniquely satisfying. That satisfaction includes the use of "real" people in fiction. Many authors gleefully kill off their schoolyard or office bullies in villains modeled after the people who make their lives miserable. Change the names to protect the guilty, but leave the rest the same and, voilà, one more demon vanquished. Of course that little bit in the front matter of the book that states, "This is a work of fiction," helps to mitigate the author's culpability should the real person upon which that villain is modeled recognize himself (or herself) in the story and take offense.
Real people appear in fiction all the time. Anyone familiar with Regency romances recognizes the name of Beau Brummell, once a friend to Prince Regent George who would become King George IV of England. Brummell rose to fame as an arbiter of men's fashion and held considerable influence over the fickle haute ton until he fled England in debt and disgrace. Royal and influential personages often feature in fiction, from France's Cardinal Richelieu who appeared in Alexandre Dumas' The Three Muskateers to English Prime Minister Winston Churchill and the USA's Daniel Boone.
The trick to using real people in fiction is to either disguise them or to ensure they have no descendants who care about that person's good name. By that measure, anyone who's been dead for at least four generations is probably fair game. Less than that, and you may face litigation from offended relatives who object to their ancestor being maligned or ridiculed. Relatives whose motive may be more greed than affront may seek to acquire a share of royalties earned from fiction that profits from the inclusion of their ancestor as a character.
Get your revenge. Off with their heads! But don't be too blatant.