According to newton's laws, why do the two different masses of an Atwood machine move in opposite directions? Consider an Atwood machine with two different masses $M$ and $m$ such that $M > m$. When trying to find the acceleration of that system, all solutions I've found go like this:
There are 2 forces that act on mass $M$, tension $\vec{T}$ and the gravitational force $\vec{F_g}$. According to Newton's 2nd law we then have $\vec{T} + \vec{F_g} = m \vec{a}$. Since $\vec{T}$, $\vec{F_g}$ and $\vec{a}$ are all parallel with $\vec{a}$ directed downward, it follows that $$T - mg = -ma$$
A similar thought process for $m$ with its acceleration directed upward yields $$T - mg = ma$$
Now one can solve for a. However why does the assumption we make about the sign of $\vec{a}$ hold? Empirically speaking this seems trivial, but I still think it should be possible to deduce this from Newton's axioms. But it seems like I am too inexperienced to do this.
I do know that $\vec{T}$ is the same for both masses, both $\vec{T}$s are directed upward with the same magnitude. I also know that both $\vec{F_g}$s are directed downward, but the one for mass $M$ is greater in magnitude than the one for mass $m$. But I don't see why $\vec{F_{g, M}}$ would be large enough to overcome $\vec{T}$ and cause mass $M$ to move downward. And why isn't $\vec{F_{g, m}}$ large enough to overcome $\vec{T}$?
 A: You don't assume a sign of the acceleration. The sign of the acceleration arises from the coordinate system you choose to use and the relative magnitudes of the forces.
Let's say that upwards is positive and downwards is negative. Let's call the masses $m_1$ and $m_2$ for this, which will make keeping track of each mass easier. A diagram of this is shown below.

You are right in assuming that each mass experiences the same magnitude of tension upwards$^*$, and the weight of each mass acts downwards. It is always helpful in problems like these to draw free body diagrams of each object. Diagrams like these can help us write out the net force on each object to use in the equation for Newton's second law. 

Therefore, for each block, Newton's second law looks like this:
$$\sum F_1=T-m_1g=m_1a_1$$
$$\sum F_2=T-m_2g=m_2a_2$$
Now, due to how the masses are linked, it must be that $a_1=-a_2$ (since if one goes up the other goes down. This can also be "derived" if you consider the fact that the length of the rope connecting the masses must be constant). For simplicity let's say $a_1=-a_2=a$. Then we can change our equations to be
$$T-m_1g=m_1a$$
$$T-m_2g=-m_2a$$
Solving for the acceleration we find that:
$$a=\frac{(m_2-m_1)g}{m_1+m_2}$$
Now, let's say $m_1>m_2$. Then we see that $a<0$. Now remember, $a=a_1$ is the acceleration of block $1$. Therefore, if block $1$ is more massive, it accelerates downward (in the negative direction based on our coordinate system). You can apply a similar argument if $m_1<m_2$. Notice how we did not assume anything about the sign of the acceleration. The sign came out of applying Newton's laws to the problem with our defined coordinate system. This is the best way to approach the problem, since in more complicated systems you might not actually know which way things are going to move at first.
It seems like it would also be helpful for you if we solved for the tension in the string as well:
$$T=\frac{2m_1m_2g}{m_1+m_2}$$
If $m_1>m_2$ (block $1$ goes down and block $2$ goes up), then we see that
$$T=\frac{2m_1m_2g}{m_1+m_2}>\frac{2m_1m_2g}{m_1+m_1}=m_2g$$
So we do see that in fact tension is large enough to lift the smaller mass. We can do a similar argument to show that the weight of mass $1$ is larger than the tension.
Therefore, we have two different ways to show that the larger mass will move down and the smaller one will move up.

$^*$ Having the tension magnitude as the same for each mass depends on two assumptions. First, if we assume the pulley is massless and frictionless, then a net torque is not needed to rotate the pulley. Contrast this with the case of a pulley with mass where each tension needs to be different in order to rotate the pulley. Second, if we assume the rope is massless, then the rope does not need to support its own weight. This means the tension will not depend on the height of each mass.
