In the spider and fly puzzle, there is a spider on the inside of a cuboidal room wondering how it would get to a fly on another point on the inside of the cuboid. Here, we just "flatten out" the cuboid in different ways and take the shortest path across all of their shortest paths. Now, replace the cube with a Tesseract. If the spider is restricted to the cubical boundaries (it can now "fly in 3-d space") and the fly is similarly on another cubical boundary, the same algorithm can be extended. Just flatten it out in 3-d space every possible way and find the shortest straight-line path among them. But what do we do if the spider loses its new power and goes back to only crawling on the 2-d surfaces (and the fly is on one of those surfaces as well). Now the trick from before where we flatten out doesn't work anymore. It is impossible to flatten out a Tesseract onto a 2-d surface without having some faces overlap (see: Prove that it isn't possible to flatten a Teserract into 2-d space.). So what do we do now? How to find the shortest path between two points on the 2-d surfaces of a Tesseract? Is there no algorithm?
NOTE: The accepted answer here: Is there a general solution for the "Spider and the Fly Problem"? in the 3-d case does require looping through unfoldings. The unfoldings are basically spanning trees. But for a given spanning tree, not sure how to get the shortest path without being able to "lay it flat".
Not an answer, just a fleshing-out of my comment that is itself too long for a comment. Making it C-W in the hope of inviting others to contribute.
For simplicity, let's work in the cube $I^{n} = [-1, 1]^{n}$ in Euclidean $n$-dimensional space, whose vertices are $n$-tuples of $1$s and $-1$s. Everything combinatorial below extends with obvious modifications to a general box $$ \prod_{j=1}^{n} [a_{j}, b_{j}] = [-a_{1}, a_{1}] \times [-a_{2}, a_{2}] \times \cdots \times [-a_{n}, a_{n}]. $$
By writing $$ [-1, 1] = \{-1\} \sqcup (-1, 1) \sqcup \{1\} $$ (disjoint union, hence $\sqcup$), we may index the set of all faces by ordered $n$-tuples $(e_{j})_{j=1}^{n}$ in $\{-1, I, 1\}^{n}$. We can usefully encode incidence data by defining $$ \begin{array}{r|rrr} \cap & -1 & I & 1 \\ \hline -1 & -1 & -1 & \varnothing \\ I & -1 & I & 1 \\ 1 & \varnothing & 1 & 1 \\ \end{array} $$ and extending componentwise: $(e_{j}) \cap (e_{j}') = (e_{j} \cap e_{j}')$. An obvious modification defines containment.
The locations of a spider and a fly may be encoded as $n$-tuples $(x_{j})$ of real numbers in $I^{n}$; the smallest-dimensional containing face of each is found by setting each $x_{j}$ with $|x_{j}| < 1$ to $I$. If each lies in the $k$-skeleton (the union of faces of dimension at most $k$), a path from the spider to the fly may be constrained by permitting it to travel only in the $k$ skeleton, or not, as the case may be.
To finish with a couple of speculative strategies (since OP and others here are more knowledgeable about data structures and algorithms than I):
In any case, a shortest path proceeds monotonically along the displacement vector from the spider to the fly, in the precise sense that if $x(t)$ is a piecewise-$C^{1}$ shortest parametrization starting at the spider $S$ and ending at the fly $F$, then $0 < x'(t) \cdot (F - S)$ for all $t$. That may usefully constrain the types of search needed.