Congress on Thursday gave final approval to legislation guaranteeing that people who experience sexual harassment at work can seek recourse in the courts, a milestone for the #MeToo movement that prompted a national reckoning on the way sexual misconduct claims are handled.