OK, short Physics lesson on sustain. This is the stuff I studied in school (Acoustical Physics)
We'll begin with a different bass than you're familiar with. It's a neck, with a zero fret and a headstock on each end - no body. No pickups, and we're operating in a vacuum. The reason to remove pickups and air is they steal some energy from the string - we'll reintroduce those losses later, but for now, we have a neck and one string.
When you pluck that one string, it decays, but as we've eliminated most of the losses, the remaining loss is that the neck vibrates, and steals energy from the string. We have losses at both ends of the string, so the decay is due to those 2 locations. Sustain is..we'll call it N seconds.
Now, we'll add a body. It's heavy. Really really heavy. Let's assume it's infinitely dense and infinitely heavy. In that case, the body won't vibrate, and all the energy that was lost at that end of the string is now returned to the string. So, we simply have half the losses we did before. It takes twice as long (with half the losses) for the string to lose a certain amount of energy, so the sustain is...2 N seconds - it's twice as long. That's our limit. What does this mean?
What this means is, assuming that mechanical losses are the only losses, the biggest improvement in sustain you can ever get by making a body heavier (assuming you're starting with absolutely no body) is a factor of 2. Since every bass has some sort of body, and since even a light body is much heavier than the neck to begin with, the factor is FAR LESS than 2. Adding in the magnetic losses from the pickup, and the air loading, which rob energy, and you've reduced that amount of sustain improvement even more.
So, the net effect of all this is, adding mass to a bass body, while it does technically improve sustain, practical speaking it isn't going to be a big factor.