3C 338 and the evolution of radio galaxies in clusters