In a significant scaling back of national security policy formed after the Sept. 11, 2001, terrorist attacks, the Senate on Tuesday approved legislation curtailing the federal government’s sweeping surveillance of American phone records, and President Obama signed the measure hours later.