This problem is not so much TurboGears as it is Python. That's not to say we can't (or won't) help, don't worry. Just remember that this applies to all the work you could do in Python.
The variable you have listed below, "test", is actually a variable within the module. I'm pretty sure the module is example.controllers.root
This means that, in order to access the variable elsewhere, you have to import the module, and then you can access the variable. Now, in your case, you'd be trying to import the root controller into subcontrollers, and that sort of practice is normally frowned upon. You might get it to work reliably, but people won't like seeing code that imports a module that imports the original module.
I would move that variable into yet another module, possibly under your lib module. From there, in each module, you can then "from example.lib.module import test" in all your controllers, and then "flash(test)" will work as desired.