[guided]Fix $z \in \mathfrak g$. The tensor $\Omega=\sum_i x_i\otimes y_i$ should be thought of as the inverse of the Killing form. To prove that it is invariant, we must show that applying $\operatorname{ad}z$ to the first tensor factor cancels applying $\operatorname{ad}z$ to the second tensor factor:
\begin{align*}
\sum_{i=1}^n [z,x_i]\otimes y_i+\sum_{i=1}^n x_i\otimes [z,y_i]=0.
\end{align*}
Because $\kappa$ is nondegenerate, it induces a nondegenerate pairing on $\mathfrak g\otimes_K\mathfrak g$ by
\begin{align*}
(u_1\otimes u_2,\ v_1\otimes v_2) \mapsto \kappa(u_1,v_1)\kappa(u_2,v_2).
\end{align*}
Thus it is enough to pair the tensor above against an arbitrary elementary tensor $a\otimes b$, where $a,b\in\mathfrak g$, and prove that the result is zero.
The pairing is
\begin{align*}
&\sum_{i=1}^n \kappa([z,x_i],a)\kappa(y_i,b)
+\sum_{i=1}^n \kappa(x_i,a)\kappa([z,y_i],b).
\end{align*}
The key input is [invariance of the Killing form](/theorems/3808):
\begin{align*}
\kappa([r,s],t)+\kappa(s,[r,t])=0
\end{align*}
for all $r,s,t\in\mathfrak g$. Applying this with $(r,s,t)=(z,x_i,a)$ gives
\begin{align*}
\kappa([z,x_i],a)=-\kappa(x_i,[z,a]),
\end{align*}
and applying it with $(r,s,t)=(z,y_i,b)$ gives
\begin{align*}
\kappa([z,y_i],b)=-\kappa(y_i,[z,b]).
\end{align*}
Therefore the pairing becomes
\begin{align*}
&-\sum_{i=1}^n \kappa(x_i,[z,a])\kappa(y_i,b)
-\sum_{i=1}^n \kappa(x_i,a)\kappa(y_i,[z,b]).
\end{align*}
Now we use the dual-basis identities. Since $(x_i)$ and $(y_i)$ are dual with respect to $\kappa$,
\begin{align*}
[z,a]=\sum_{i=1}^n \kappa(x_i,[z,a])y_i,
\qquad
a=\sum_{i=1}^n \kappa(x_i,a)y_i.
\end{align*}
Pairing these expansions with $b$ and $[z,b]$ respectively gives
\begin{align*}
\sum_{i=1}^n \kappa(x_i,[z,a])\kappa(y_i,b)=\kappa([z,a],b),
\end{align*}
and
\begin{align*}
\sum_{i=1}^n \kappa(x_i,a)\kappa(y_i,[z,b])=\kappa(a,[z,b]).
\end{align*}
Thus the original pairing equals
\begin{align*}
-\kappa([z,a],b)-\kappa(a,[z,b]).
\end{align*}
This is zero by the same invariance identity for $\kappa$. Since every pairing against $a\otimes b$ is zero and the tensor pairing is nondegenerate, the tensor itself is zero.[/guided]