Sorry, foam in the handlebar will not reduce vibration. We tested this myth one time before, and in our tests, filling the handlebars with foam or silicone did nothing (and if you thing about the high-frequency nature of vibrations you can see that lightweight foam or silicone-style putty would have no effect on these vibrational waves).
You can reduce vibration by adding weight.
Heavier barends help but not much.
I found filling the bars with lead, steel, or tungsten (heaviest and best, but hard to find) pellets (shotgun or airsoft) and heavy barends make a big difference.
You'll want to fill the bars with the pellet and then add Elmers school glue to keep them from rattling in the bars.
You could use a stronger glue but if for some reason you want to remove the pellets you'll want an easy to break glue.
Plus the Elmers flows easily into all the spaces between the pellets.
Leave just enough space to add the barends.
Too much space, and the pellets may work loose and rattle against the barends.