HOUSTON, Texas — Major energy companies are shrugging off pressure from environmental groups and some shareholders to abandon new spending on developing fossil fuels and instead invest in low-carbon energy sources as they anticipate high demand and earning potential in oil and gas persisting for years to come.