Note; I'll use the summation convention throughout here.
In the context of differential geometry, the indices on tensorial objects are raised and lowered with the metric on the space (manifold) being studied. So for example $$ T^i_{\phantom i j} = g^{ik}T_{kj} $$ and $$ T^{ij} = g^{ik}g^{jl}T_{kl} $$ Notice that if the metric is simply that of Euclidean space, namely if $g_{ij} = \delta_{ij}$, then raising and lowering does not change the numerical values of tensor components. In particular, one would have $$ T^{ij} = T_{ij} $$ Notice that in expressions like $$ T^{ij}T_{ij} $$ both indices are being summed over, where as in the expressions $$ (T^{ij})^2, \qquad (T_{ij})^2 $$ one usually (this is actually a matter of notational preference) doesn't intend for their to be any implied summation, so typically its notationally safe to assume that $$ T^{ij}T_{ij}\neq (T^{ij})^2, \qquad T^{ij}T_{ij}\neq (T_{ij})^2 $$ but if the metric is Euclideansatisfies $g_{ij} = \delta_{ij}$, then it is true that $$ (T^{ij})^2=(T_{ij})^2 $$