The music that plays upon earning a Gym Badge in Pokémon Pearl (and Diamond/Platinum) is a triumphant variation of the "Victory Fanfare"—the same core melody used for battle victories, but with a more celebratory, fanfare-like arrangement (added brass, percussion, harmonic richness).
It is not a wholly unique composition; it's a special arrangement of the standard Victory theme triggered specifically by badge acquisition.