Prick the sweet potatoes with a fork or the tip of a paring knife; set aside. Cut off the top of the heads of garlic to expose the cloves, trimming about 1/4 inch off of the top of each clove. You may need to trim individual cloves along the sides of each head. Brush the cut cloves with the olive oil, then nestle each head into a piece of aluminum foil.
Place the sweet potatoes and garlic cloves directly on the oven racks. Bake for about 1 hour, removing the sweet potatoes once they have softened, and removing the garlic heads once they are tender and nicely browned.
Peel the sweet potatoes, and place into a mixing bowl. Squeeze the individual garlic cloves into the bowl, then add the butter, sour cream, cream cheese, and cayenne pepper. Mash until smooth, then season to taste with salt and pepper. Scrape the mashed potatoes into a 1 1/2 quart baking dish, and return to the oven for about 15 minutes to reheat.