Mr. Trump’s announcement during his State of the Union speech was light on details, and experts said that any promises by tech companies to pay more for their electricity could be difficult to verify or enforce in practice. Yet the move underscored the extent to which White House officials and Republicans have worried that rising electricity prices could hurt them in the midterm elections this year.