Recent hacks of election data systems in at least two states have raised fear among lawmakers and intelligence officials that a foreign government is trying to seed doubt about — or even manipulate — the presidential race, renewing debate over when cyberattacks cross red lines and warrant a U.S. response.