After you file

The original answer is correct if the question was "can the federal refund pay the state balance due  or the reverse on a filed return " which is a big no.  Some folks think that a refund on one return will automatically pay the balance due of the other return for the same tax year and fail to pay the balance due then get notices that they did not pay and now owe penalties and interest.   However  once a return is  filed  then a state refund can be grabbed by the IRS to pay a prior year debt and vise versa.