Republicans and Democrats in the House and Senate were struggling to end a standoff over immigration policy as leaders from both parties tried to gain the upper hand by blaming one another for triggering the first government shutdown in more than four years.