5. Let integer $n \geqslant 2$,
$$
A_{n}=\sum_{k=1}^{n} \frac{3 k}{1+k^{2}+k^{4}}, B_{n}=\prod_{k=2}^{n} \frac{k^{3}+1}{k^{3}-1} \text {. }
$$

Then the size relationship between $A_{n}$ and $B_{n}$ is
5. $A_{n}=B_{n}$.

From the problem, we have
$$
\begin{array}{l} 
A_{n}=\sum_{k=1}^{n} \frac{3 k}{\left(k^{2}-k+1\right)\left(k^{2}+k+1\right)} \\
=\frac{3}{2} \sum_{k=1}^{n}\left(\frac{1}{k^{2}-k+1}-\frac{1}{k^{2}+k+1}\right) \\
= \frac{3}{2}\left(1-\frac{1}{n^{2}+n+1}\right) \\
= \frac{3 n(n+1)}{2\left(n^{2}+n+1\right)}, \\
B_{n}=\left(\prod_{k=2}^{n} \frac{k+1}{k-1}\right)\left(\prod_{k=2}^{n} \frac{k^{2}-k+1}{k^{2}+k+1}\right) \\
= \frac{n(n+1)}{1 \times 2} \cdot \frac{2^{2}-2+1}{n^{2}+n+1}=\frac{3 n(n+1)}{2\left(n^{2}+n+1\right)} .
\end{array}
$$

Therefore, $A_{n}=B_{n}$.