The court upheld an appeal by miners against a high court victory for environmentalists but recognised the defence in a landmark ruling on abusive litigation