A key surveillance tool seen as vital in preventing terror attacks and catching foreign spies is set to expire after congressional efforts to temporarily extend it failed in bipartisan fashion.