Getting back to the OP, a character may function in the
plot in a "villainous" role, but remain a tragic character. We could easily imagine the
Minas Tirith Players staging "The Tragedy of
Denethor,
Steward of Gondor" some time into the high mimetic world of The
Fourth Age.
There can be different kinds of tragedy, and tragic heroes, as several posts here have mentioned. One way of looking at them is as on a spectrum, moving from the more romantic, with stories of lost innocence or young lives cut off, like Romeo and Juliette, through what we normally think of as the typical tragic hero, who through hubris commits a provoking act against the natural order, whether deliberately like Macbeth, or inadvertently like Oedipus, and on into more ironic forms, where the term "hero" seems less and less appropriate, until we meet characters who experience only unrelieved suffering, such as those in Kafka. At either end, it's difficult to justify something like hubris or "tragic flaw".
Looked at this way, we can see
Boromir in the center, with
Frodo on one side, and Denethor on the other. Leaving Frodo aside, Denethor's story is clearly more ironic than Boromir's: there is a feeling that he's failed to make any real heroic
point, as shown by both the manners of, and reactions to, their respective deaths. The source of at least one his grievances, the rift between the Northern and Southern
kingdoms, closes up over his head, as it were. It doesn't make him less of a tragic
character, but the ironic element introduces judgement by his society, much more than is the case with Boromir.