An energy bill requiring greater fuel efficiency in US cars and trucks has been passed by the Senate.