The companies acted under threats of federal regulation after reports that Russian operatives bought politically divisive social media ads under fake names.