Yes, but it’s not easy:
If you’ve been trespassed from a public place, you can challenge it by way of “judicial review” – which means going to the High Court (see the chapter “Dealing with government agencies”, under “Challenging decisions and conduct of government agencies”). If you’re trespassed from Parliament for example, the decision to trespass you must be reasonable (see below).
If you’ve been trespassed from private property you could take a civil case to the courts to challenge the validity of the trespass notice.
If you’ve been arrested and charged with trespass, whether on public or private property, you may be able to challenge the legality of the trespass notice during your trial.