States’ struggles to satisfy energy mandates offer lessons for the next administration.