Agency wins fight over Yellowstone dam, endangered fish