Comment: the notation for the von Neumann algebra generated is terrible, as now you have no notation for the union. I will use the union as a union.
Notation: $W^*(S)$ is the von Neumann algebra generated by the set $S$. It is easy to check that $S'=W^*(S)'$: we have $S'=S'''=(S'')'=W^*(S)'$. So you actually only need to do your argument with the union, and not with the algebra generated.
Suppose that $T\in (\bigcup_j M_j)'$. Then, $T\in M_j'$ for any $j$, so $T\in\bigcap_jM_j'$. Conversely, if $T\in \bigcap_jM_j'$ then $T\in M_j'$ for all $j$; so $T\in(\bigcup_jM_j)'$.
Now, using the first equality.
$$
W^*\Big(\bigcup_jM_j\Big)=\Big(\bigcup_jM_j\Big)'' =\Big[\big(\bigcup_jM_j\big)'\Big]'=\Big[\bigcap_jM_j'\Big]'
$$
Edit: proof that the von Neumann algebra generated by a selfadjoint set $S\subset B(H)$ is $S''$.
Since $S''$ is a von Neumann algebra and it contains $S$, then $W^*(S)\subset S''$. Conversely, since $S\subset W^*(S)$, then $W^*(S)'\subset S'$, so $S''\subset W^*(S)''=W^*(S)$.