It's not so much "better" as "more appropriate given the setup".
The T5 bulbs are also called "high output" bulbs. They don't
really produce more UV, but they do produce stronger UV that
has a longer effective range. With a T5 bulb, it can be a bit further away
than a T8 bulb and still be effective, and in fact, if the bulb is inside
the cage [not being diminished by any screens], you want to make sure
that the dragon isn't getting too close to the bulb.
However, getting a T5 bulb means also getting a T5 fixture, which may
mean more expense. You can't use a T5 bulb in a "normal" T8 fixture, nor
vice versa.
So really it just depends on your current setup, placement of the light,
size of the cage, and so on.