Let's do the unit cube and worry about the side length later.
Let's assign F(0,0,0), H(1,1,0), A(0,1,1), C(1,0,1)
Let's call the beetle positions P and Q, functions of time t.
P = F + 2t(H-F) = tH = 2t(1,1,0) = (2t,2t,0)
Q = A + t(C-A) = (0,1,1)+t(1,-1,0)=(t, 1-t, 1)
The squared distance is
Answer: 440