Trample works by requiring the attacking player to assign at least lethal damage to each blocking creature before assigning any damage to the defending player (CR 702.19b). Lethal damage is defined as damage equal to or greater than the creature's toughness, accounting for any damage already marked on it (CR 702.19c).
Indestructible means a permanent cannot be destroyed by damage or by effects that say 'destroy' (CR 702.12b). Crucially, damage is still marked on an indestructible creature — it simply doesn't die from it. The rules for trample only care whether lethal damage has been assigned, not whether the blocker will actually die (CR 702.19b).
Therefore, if you attack with a 5/5 trample creature and it is blocked by a 2/2 indestructible creature, you must assign at least 2 damage to the blocker (lethal damage = its toughness), and you may assign the remaining 3 damage to the defending player. The 2/2 won't die, but the 3 tramples through regardless.
This also applies to regeneration shields and similar effects: lethal damage only needs to be assigned to the blocker to satisfy trample, regardless of what happens to that creature after damage resolves.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.