Given a collection of rectangular matrices $A_i, B_i \in \mathbb{R}^{k \times d}$ for $1 \leq i \leq n$, I am looking for an analytical solution for orthogonal matrices $U \in \mathbb{R}^{k \times k}$ and $V \in \mathbb{R}^{d \times d}$ with $U^T U = I_k$ and $V^T V = I_d$ that minimize \begin{align} \sum_{i = 1}^n \lVert U A_i V^T - B_i\rVert_F^2. \end{align}
In the case that $i=1$ the answer should reduce to something similar to this question after diagonalizing $A$ and $B$ via the SVD. I also understand that it may be the case that there are an infinity of solutions which is fine.
That said, I'm finding it tricky to attack this problem. One idea I've had is to linearize the system with the Kronecker product to equivalently(?) minimize \begin{align} \lVert W \, [ \textrm{vec}(A_1), \ldots, \textrm{vec}(A_n)] - [\textrm{vec}(B_1), \ldots, \textrm{vec}(B_n)] \rVert_F^2 \end{align} for orthogonal $W$ subject to the constraint that $W = V \otimes U$, but I don't know how to impose the latter.