The legislation, which seeks to revive, codify and stiffen a series of border policies pursued by the Trump administration, was timed to be considered on the eve of an expected border surge.