The median plan’s returns rebounded from weak gains in the second quarter and negative returns a year ago.