Yes, a vampire's bite can sometimes effectively deal extra damage due to temporary hit points
Damage to temporary HP still counts as damage
Per this Jeremy Crawford Tweet:
When temporary hit points absorb damage for you, you're still taking damage, just not to your real hit points.
So, when the bite ability says "hit point maximum is reduced by an amount equal to the necrotic damage taken" that means that max HP will be reduced by the amount of damage done regardless of temp HP.
Your example
In your example, your maximum HP is 20. Your current HP will also start at 20 since you have taken no damage before this. You also start with 20 temporary HP from some spell or effect.
Starting condition
Max HP: 20
Curr. HP: 20
Temp. HP: 20
So, you take 5 piercing damage and 10 necrotic damage.
Max HP: 20
Curr. HP: 20
Temp. HP: 20 - 5 (piercing) - 10 (necrotic) = 5
Then, because of the vampire bite, your maximum HP is reduced by 10.
Max HP: 10
Curr. HP: 10
Temp. HP: 5
And because your maximum HP drops below your current HP, your current HP immediately drops with it. This is because current HP can never exceed max HP:
A creature's current hit points (usually just called hit points) can be any number from the creature's hit point maximum down to 0. This number changes frequently as a creature takes damage or receives healing.
In this case then, a **vampire's bite, will do additional damage to your HP because of the HP drain and the fact that you had temporary HP.
Specifically it did:
5 (piercing)
10 (necrotic)
10 (HP drain)
= 25 damage
A creature without temp HP would have taken 15 damage. So, yes a creature with temp HP in this case actually effectively takes more damage than a creature without.
Temporary HP is not affected by HP drain since it is independent of max HP.
Official ruling
Jeremy Crawford has agreed with this interpretation in this tweet:
Q: You are hit by a Specter's Life Drain for 10 damage. You have 8
temporary hit points. Is your Max HP lowered by 2 or by 10?
A: By 10
Note that I have been referring to the HP maximum reduction as "damage". I do not mean damage in the technical sense (eg effects that depend on "you take damage") but in the common sense that you lost HP thus it is effectively damage.
No they do not
The books do not clarify the matter, but Jeremy Crawford has said:
When temporary hit points absorb damage for you, you're still taking
damage, just not to your real hit points.
when confirming that temporary HP lost will count toward the DC of a concentration check. This implies that the loss of temporary HP should trigger any effect that happens on the loss of HP.
Best Answer
Life drain's effect is the same with or without temporary HP
Rules as Intended: Damage to temporary HP still counts as damage
Per this Jeremy Crawford Tweet:
So, when the Life Drain ability says "hit point maximum is reduced by an amount equal to the damage taken" that means that max HP will be reduced by the amount of damage done regardless of temp HP.
So, the temp HP absorbs as much damage as it is able to absorb, but that damage is still considered taken (no matter how much or little temp HP you have). Then, that damage number (which again is unaffected by how much temp HP you had), is subtracted from your HP maximum. Your current HP will also be reduced if the HP maximum is reduced to below your current HP.
Jeremy Crawford has agreed with this interpretation in this tweet:
So, to answer you question directly:
Yes, Life Drain's max hp reduction will work if the damage is less than available temporary hit points.