Did you try cleaning the connectors in the sockets of the tail lights?
If that doesn't work I would suggest maybe ordering replacement sockets (P/N 4676589)
if all else fails replacement tail lights. You can get OEM replacements for around $105 - $117 per unit depending on your year model.
(Do note that the tail lights sold on Just For Jeeps don't come with sockets or bulbs so maybe Ebay might be your best bet for that)