The Supreme Court agreed to take up an effort by energy companies to end a lawsuit filed in state court that seeks billions of dollars in damages.