If you are maximizing output for fixed cost or minimizing cost for fixed output (there is a duality that makes these two optimization problems equivalent), the price you pay for a given amount of marginal product will be the same. So if they were maximizing profit, they would be paying the same rate for marginal product of capital as for marginal product of labor.
I can prove this using a Lagrangian; I will as a sort of "appendix" below. If that's too advanced for what you're familiar with, just don't worry about that appendix and take it as given that price of marginal product should be equal for maximizing profit.
But they are not; they have too much labor, not enough capital.
Since their marginal product of labor is 40 units per day, for which they are paying a wage w of $20 per day, this is how much they're paying for marginal product of labor:
w/MPL = 20/40 = $0.50 per unit
Since their marginal product of capital is 120 units per day, for which they are paying rent r of $30 per day, this is how much they're paying for marginal product of capital:
r/MPK = 30/120 = $0.25 per unit
For output function f(K,L) of products sold at price P, we are maximizing profit PF. We pay rent r on capital and wage w for labor; thus our constraint is r K + w L = C where C is a constant, how much money we have to spend. (Its precise value won't matter for the theorem, so long as it is a constant.)
PF = P * f(K,L) + lambda (rK + wL - C)
dPF/dK = 0 = P * f_K + lambda r
dPF/dL = 0 = P * f_L + lambda w
Solve for lambda in each case:
lambda = - P * f_K / r = - P * f_L / w
f_K / r = f_L / w
r/f_K = w/f_L
where the partial derivatives f_K and f_L are just the marginal products of capital and labor respectively.
r/MPK = w/MPL.