Every attorney, agent, guardian, executor, or administrator seized or having the care of lands, as indicated, who shall be put to any trouble or expense in listing or paying the taxes on the lands, shall be allowed a reasonable compensation for the time spent, the expenses incurred, and money advanced as indicated, which shall be deemed in all courts a just charge against the person for whose benefit the services shall have been advanced. The claim shall be preferred to all other debts or claims and be a lien on the real estate as well as the personal estate of the person for whose benefit the services shall have been advanced.