Republicans who had blocked the bill, which would extend benefits to an estimated 3.5 million veterans, allowed it to pass after trying unsuccessfully to limit funding for the treatments.