HOUSTON — When the Obama administration began considering the Keystone XL pipeline seven years ago, oil production in the United States was falling and most analysts thought it would never recover. At the same time, Mexican oil production was also in decline, meaning that domestic refineries would soon need another source of crude.