A working group of senators from both parties is nearing agreement on broad principles for overhauling the nation’s immigration laws, representing the most substantive bipartisan effort toward major legislation in years.