I would implement Tobler's hiking function in ArcMap. The main rationale is that hiking optimal routes may be (mainly) influenced by slope, which affects hiking speed. There are many hiking functions available, but Tobler's one seems (on the basis of available scientific literature) to still hold a general validity.
In ArcMap, Tobler's function can be implememted through the Path Distace tool, which takes a couple of different inputs: a DTM, a SLOPE raster, and a customized Vertical Factor table representing the estimated time to traverse one unit of space at different slope values. As for the latter table (as well as for the implementation in general), you may find a good step by step tutorial here: https://bcourses.berkeley.edu/courses/1289761/pages/in-class-exercise-11-dot-2-cost-distance
What you will get is an accumulated cost raster, representing the walking time from your start location, and a backlink raster which you can use afterward to find the least-cost path between A (source) and B (destination).
In your case, since you have trails (in vector format, I guess), I would create a small buffer around them, and cut the DTM to the extent of the buffered trails (using Extract by Mask tool). Then, I would calculate the slope on the basis of that "modified" DTM. Those rasters (cut DEM and SLOPE) would be the ones to be fed into the Path Distance tool.
Bear in mind that the least-cost path obtained is anisotropic, that is it varies according to the direction of movement. So, going from A to B can be not as costly as going from B to A.
Hope this helps.