The final passage of a massive public works bill gives the President a major bipartisan accomplishment, but only after a string of setbacks and delays