WASHINGTON — The House passed legislation Wednesday to give hundreds of thousands of foreign-born youngsters brought to the country illegally a shot at legal status, a fleeting victory for an effort that appears doomed in the Senate.