Court overturns Trump decision following a lawsuit filed by environmental groups