Train passengers have been put on notice after a powerful union warned that “industrial action will recommence immediately” after a court win.