A court says bankrupt firms must put the environment ahead of other creditors