From the polymorph in the SRD "The subject’s creature type and subtype (if any) change to match the new form."
From the hold person in the SRD "Target: One humanoid creature."
Here's an alternate ruling. Once the target is no longer a humanoid creature, I think it's fair game for the DM to say that the hold person spell no longer works. But, this doesn't mean the spell's duration is over, because the effect was originally in place on a proper target. So, if the troll is then changed into a humanoid, and the duration of hold person hasn't expired, it seems reasonable that the now-again-humanoid would have to save or be held.
Dave
From the hold person in the SRD "Target: One humanoid creature."
Here's an alternate ruling. Once the target is no longer a humanoid creature, I think it's fair game for the DM to say that the hold person spell no longer works. But, this doesn't mean the spell's duration is over, because the effect was originally in place on a proper target. So, if the troll is then changed into a humanoid, and the duration of hold person hasn't expired, it seems reasonable that the now-again-humanoid would have to save or be held.
Dave