The ratepayer protection pledge marks the latest step in President Trump’s push to address a significant political challenge — mounting electricity prices — before the November midterm elections.