Ash Barty, the top-ranked women’s tennis player in the world, announced her retirement from the sport Tuesday.