Network Rail boss blasted for chaos quits