Does heat balances out or Temperature balances out? Let's say we have $2$ elements
Tin: Thermal Capacity $226\ \text {J/kg°C}$
Magnesium: Thermal Capacity $1024\ \text {J/kg°C}$
Let's say I have a $1\ \text{kg}$ block of each element at $40°C$, and I put them touching each other.
In this scenario, the Magnesium block has more heat energy in it because more heat was needed to raise its temperature up to $40\ \text{°C}$. Now the question is, does heat transfer to the block of Tin? Because there is less heat energy on that block? Or does both stay the same because both have the same temperature?
 A: Thermal equilibrium will occur when the bodies have the same temperature.
In a fundamental sense, heat flows to increase the entropy (a measure of the disorder) of the combined system. Temperature can be defined as the rate at which internal energy increases with increasing entropy (mathematically, $T = \frac{\partial U}{\partial S}$). Thus, where the temperature of the bodies differs, entropy can be increased by heat transfer from the higher temperature body to the lower temperature body.
A: They both stay at the same temperature and the heat does not flow. Heat always flows from higher to lower temperature, and if the temperatures are equal then the heat does not flow.
This fact is used in modern air-conditioning systems. They use only 1 kW electrical power to produce 3-4 kW thermal power. This seemingly violates laws of physics! The trick is that outside air, no matter how cold, has some thermal energy in it. If you increase air pressure by some factor, the thermodynamic temperature (Kelvin) also increases by the same factor. The heat from the compressed air will now flow to the surroundings at lower temperature. Please note that this is simplified description of how such systems actually work.

The situation is the same with electrical circuits. Imagine a capacitor where capacitance equals thermal capacity and voltage equals temperature. Current flows from higher potential to lower potential. If you connect two capacitors together, and if they were initially at the same voltage, the current will not flow regardless to the fact that one capacitor might have stored more energy.
A: Thermal equilibrium implies equal temperatures: temperature can be defined as the inverse of a derivative of the entropy in respect to the internal energy:
$$
\frac{1}{T}=\left(\frac{\partial S}{\partial E}\right)_{V,N},
$$
where $S$ and $E$ are both functions of state. It can then be shown for two bodies that initially have temperatures $T_1, T_2$ and can exchange heat, that the overall entropy increase will be:
$$
\Delta S=-\left(\frac{dS}{dE}\right)_1\Delta E+ \left(\frac{dS}{dE}\right)_2\Delta E = \left(\frac{1}{T_2}-\frac{1}{T_1}\right)\Delta E.
$$
That is, if $T_1>T_2$, the heat will flow from the first body to the second, so that the overall entropy increases (here $\Delta E = \Delta E_2 =-\Delta E_1=0$).
Thus, in tehrmodynamic equilibrium the net heat flow is zero and the temperatures are equal.
However, heat exchange is not the only means by which two systems can come to thermal equilibrium - the internal energy can be changed by performing work (i.e., by macroscopic energy transfer, whereas heat is microscopic energy transfer) as well as by particle exchange. The full thermodynamic equilibrium thus also requires additional conditions on pressures, chemical potentials, etc.
A: 
Now the question is, does heat transfer to the block of Tin? Because
there is less heat energy on that block? Or does both stay the same
because both have the same temperature?

There is no heat transfer and the temperature of both blocks stays the same. The reason there is no heat transfer is because heat is energy transfer due solely to temperature difference. If there is no temperature difference, there can be no transfer of energy in the form of heat.
It is important not to think of the thermal energy contained in blocks as being heat, even though the term heat capacity is used. The thermal energy contained in both blocks is properly called internal energy and is generally some combination of kinetic energy (due to molecular motion) and potential energy (due to intermolecular forces).
The fact that the internal energy of the magnesium block is greater than the internal energy of the tin block does has nothing to do with the potential for heat transfer, which requires a temperature difference. It does tell us how much heat can transfer, for a given temperature difference.
Hope this helps.
A: Thermal equilibrium is on the basis of temperature, not total stored energy (whether thermal or otherwise).
