There are lots of players who probably dented their averages by retiring too late (sachin, ponting ect) but who are the ones who retired from tests whose average was not on the decline or may have even improved. Sangakara is one for me, he finished on 57 but watching him in his final years I would say he as good as he ever was and could have still played for 3 or 4 more years.
Examples of batsman and bowlers please
Examples of batsman and bowlers please