The Supreme Court dealt a blow to environmental groups Thursday as it sided with a railway company who argued a review of a planned construction project was overbroad—giving a boost to oil and gas billionaires who weighed in on the case and asked for more restrictive environmental studies.