WASHINGTON—The Senate Tuesday passed an $8.1 billion measure to replenish the fund that pays for highway and bridge repairs, taking a different approach from the House and creating last-minute trouble for legislation that Congress must pass in the next several days to prevent the fund from becoming depleted.

The Senate voted 79-18 after lawmakers adopted amendments that would fund the bill differently than a measure the House passed earlier this month. The Senate bill would extend the Highway Trust Fund, which consists of...