The bill, approved 85 to 12, united Republicans and Democrats around a measure to better align the nation’s energy infrastructure with the changing ways that power is produced.