You are correct that the entropy of the coffee will decrease while the entropy of the cup increases. However this will not decrease the total entropy of the system.
Rather, heat will continue to flow between the two objects until entropy can no longer increase.
Let $\Delta S$ mean the change in total entropy as the energy of contents of the two components change by $\Delta Q_\text{cup,coffee}$. For infinitesimal energy transfer, we should have $$\Delta S = \beta_\text{cup} \Delta Q_\text{cup} + \beta_\text{coffee} \Delta Q_\text{coffee}$$
for some quantity $\beta$, that is not necessarily the same for both components. Let us see what this quantity is.
Since energy is conserved, we have $\Delta Q_\text{coffee}= - \Delta Q_{cup}$ and we can write the change in entropy as $$\Delta S = \Delta Q(\beta_\text{cup} - \beta_\text{coffee}).$$
Here I have taken $\Delta Q = \Delta Q_\text{cup}$ to be positive -- it's the heat gained by the cup. Thus the entropy change is consistent with thermodynamics if $$\beta_\text{cup} \ge \beta_\text{coffee}.$$ The condition for equilibrium is $$0 = \Delta S \Leftrightarrow \beta_\text{cup} = \beta_\text{coffee}.$$
We see that $\beta$ is a quantity that is equal when two systems that can exchange heat are equilibrium -- it must be a function of the temperature. Since heat flows from objects with smaller $\beta$ to objects with greater $\beta$, we define temperature through the relation $\beta = 1/T$.
The comments have gotten this one answered pretty well, actually. Remember that the 2nd law operates on the entire universe, not just the object itself. So while yes, your generator makes itself some energy, it loses more energy than it makes. Let's take a look at some equations:
Gravitational Potential Energy is equal to $a_g*m*h$. If our magic box starts at sea level and rises to 3 km in the atmosphere, and its total mass is 100kg, then the amount of energy needed to raise it there is $\approx9.81*100*3000$ or 2943000 J.
Now, let's assume that the box is 90% atmosphere and 10% mechanisms. Simply by returning the box to the ground, we get back just under 10% of the energy. Now, what about the pressure differential?
Our turbine is a wind turbine, basically, so we can use wind turbine equations to solve its energy generation. Basically, through a complex derivation process, you get $P = \frac{1}{2}\rho A v^3$, which describes the density of air ($\rho$), the velocity of the air (We'll use the maximum of 343m/s) and the cross sectional area of the turbine.
Now, how do we go about finding A? Since we know that the velocity is 343 M/s, we can use $\frac{flow\space rate}{area} = velocity$. Flow rate is expressed in volume per time. The density of air at sea level is 1.2$\frac{kg}{m^3}$, and we have 90 kg, so we have a volume of 108$m^3$. Our equation seems to look like
$$\frac{Joules}{second} = \frac{1}{2}*(1.2\frac{kg}{m^3})*area*\frac{\frac{volume}{second}}{area}$$
Simplifying, we get $J = .5*\rho * volume$, which yields... 64.8 J. 64.8 J is far less than the couple million it took to get the thing up there.
Best Answer
The second law of thermodynamics does not prohibit any ball from moving to another container because that would shift the system into a lower entropy configuration.
The question originated from a widespread misconception. There is nothing like the entropy of one configuration in statistical mechanics. Entropy is a property of the macrostate. Therefore, it is a collective property of all the microscopic configurations consistent with the macroscopic variables uniquely identifying the equilibrium state. The physical system visits all the accessible microstates as a consequence of its microscopic dynamics. Among these states, there are states with an unbalanced number of particles in the two containers. People refer to such states as fluctuations around the average equally distributed case. It is an effect of the macroscopic size of thermodynamic systems that the overwhelming majority of the microscopic states does not show large fluctuations.