Word for "best person in a group of bad people"
I've heard and read The best of a bad lot for that one.
All existing answers are effectively popular/slang expressions (and "best of a bad lot" doesn't work for Brits, who invariably use "best of a bad bunch"). If OP wants an alternative suitable for a somewhat more "up-market" context...
faute de mieux - for want of something better; for lack of an alternative.
...will often be suitable. Note that we don't say "this prisoner is faute de mieux" - you need to phrase it as something like "I'll have to make this prisoner a trustee, faute de mieux". Also note that the French origin is still generally acknowledged by italicising the written form - but here are nearly 20,000 written instances, showing that it's commonly used by Anglophones.
Not a word or phrase for the concept, but a proverb that describes the situation is:
In the land of the blind, the one-eyed man is king.
The best of the worst, maybe. It's catchy, but I don't know if it's in popular usage.
As others have noted, lesser of two evils seems to be the best match for the concept you're looking for. I don't know of a perfect way to extrapolate the concept beyond two people, but the term lesser evil comes to mind. While it still suggests two, it's less explicit. That term also sees considerably more use than least evil or least of all evils, which seem appropriate but feel awkward to use.