The cases, brought by Northern Rail and TransPennine Express, were thrown out after it emerged the companies had wrongly used a legal procedure to prosecute passengers