In most cases retreating a root canal conventionally is preferable to having and apicoectomy. Retreating a root canal usually has a higher success rate than apical surgical repairs (apicoectomey)since teeth with apicalectomies seem to have a higher failure rate (they get a reoccurring of the infection at the apex).
Apicoectomies are preferable if the canal can no longer be safely renegotiated. This can happen if a post has been placed and an endodontist or dentist doesn't believe it can be safely removed. Also some root canal filling materials can be difficult to remove( a small minority)
Many posts can be safely removed, but some can be more difficult than others. If attempting the removal of a post has a high likelihood of placing the future of the tooth in jeopardy, than an apical procedure or an extraction may be a better option.