A shipbreaking firm bought the vessel to dismantle it, and the ship now known as the Oriental Nicety entered Indian waters last week.
The court order says the erstwhile Exxon Valdez should not be allowed to berth until it has been decontaminated.
Environmental activist Gopal Krishna said Wednesday that state authorities subsequently canceled permission for the ship to anchor near the Gujarat state coast.
The company contracted to dismantle the ship plans to appeal.
The court cited a U.N. convention that calls for decontamination in a ship’s country of export. Mercury, arsenic, asbestos and residual oil can contaminate ship hulls and holds.