It would technically be topiary, meaning a plant shaped to grow in some decorative manner or form of the owner's choice - that could be a square, globe, pyramid and a myriad of other forms which might resemble animals, insects or birds, or spirals, or pillars, or even a human being. Note that plants used for topiary are those which respond well to regular clipping or shaping, and are evergreen, such as Buxus, Lonicera nitida, Ligustrum, Yew. The amount of clipping required to shape a fruit tree in such a manner would compromise the health of the plant, and its cropping potential, and as such, they are not really suitable candidates for real topiary.
Espalier really means a trellis or support against which plants are trained flat, but the term has come to mean a form of training. As you rightly say, usually used for fruit plants in small areas, and pruned flat against a wall or support, often to maximise crop production and create ease of access to fruits, or to successfully grow fruit in small areas. This form of pruning is always done with the health of the plant, and the fruiting crop, in mind, rather than for decorative purposes.
UPDATE in response to Comment:
No, its not the shape that defines it, Coomie, but the purpose for which it is done. As Kate clarifies, topiary is done for purely decorative reasons, whereas espalier is not, although some might consider the result to be decorative.
If you want a more difficult classification to think about, consider cloud pruning. This is a form of topiary, but not classic topiary, and its used usually on certain trees or large shrubs. It is done specifically for its attractive effect, but is still called 'pruning' rather than 'topiary'. Classic topiary is as described in the first part of my answer. Note that classic topiary and cloud pruning are restricted to certain plants, none of which will be fruit cropping ones.