Decision overturns 20-year-old precedent and could trigger immediate release of 92 people, with detention of 340 others also in doubt