A group of protesters have been handed a significant legal victory as a judge found a controversial police designation was “invalid”.