Workers will hold walkouts over a period of six weeks amid a long-running dispute over the role of guards on trains.