The ruling is a blow to the European Union's attempt to curb corporate tax avoidance but the bloc could still appeal the decision.