More than 28,000 prosecutions brought by York-based Northern for alleged fare evasions have been quashed.