Any legatee, heir, distributee, or creditor may be admitted by the court to defend any suit against the executor or administrator of the estate in which he is interested, and the case shall be tried and judgment rendered as if the suit had been defended by the executor or administrator; but judgment shall be given against the party for costs incurred in consequence of his becoming a party, if judgment shall be had against the executor or administrator.