Short answer. Yes. Under Civil Code Article 938, once a testator expressly declares that a legacy is to be applied to a debt owed to the creditor-heir, the creditor keeps the right to collect the excess, if any, of whichever amount is larger, the credit or the legacy.
What the law says
In the latter case, the creditor shall have the right to collect the excess, if any, of the credit or of the legacy or devise.
Civil Code, Article 938 — A Legacy to a Creditor. Read the full provision →
The default rule, and why an express declaration matters
Article 938 starts from a default that runs the opposite way from what you might expect: a legacy or devise made to a creditor shall not be applied to his credit, unless the testator so expressly declares. Ordinarily, then, a legacy left to someone who happens to also be owed a debt is treated as a separate, additional gift, not automatic payment of what was owed. That default only flips if the will itself expressly says the legacy is meant to satisfy the debt. If your father's will contains that kind of express declaration, Article 938 treats it as the exception the law allows, and the legacy is applied to the debt as he directed.
What happens once the legacy is applied to the debt
Once the testator has expressly made that declaration, Article 938 does not let the estate simply absorb whatever value is left over if the legacy exceeds the debt. It states plainly that in that situation the creditor shall have the right to collect the excess, if any, of the credit or of the legacy or devise. In other words, the larger of the two figures still controls what you are ultimately entitled to receive: if the legacy is worth more than the debt, you keep the right to collect that additional amount rather than losing it because your father chose to route payment of the debt through the legacy.
The reverse situation, briefly
The same rule works symmetrically if the numbers run the other way. Had the debt been larger than the legacy, the excess of the credit over the legacy would remain collectible as an ordinary debt of the estate, separate from whatever the will gave you as a legacy. The legacy and the debt are treated as applied against each other only up to the smaller figure, with whichever obligation had the larger value surviving for the difference. Your entitlement to that difference does not depend on the estate's convenience; it follows directly from Article 938 once the express declaration condition is satisfied.