Hi,
There's unfortunately not really a solution for this; not all CSS can be inherited right now.
Most obviously, this won't work with SVG output (where text-decoration would simply not apply); the best chance would be the CommonHTML output (it is "simpler" than the HTML-CSS output), but even there, the inheritance is not really possible.
The "normal" way would be to solve this on the input end, (e.g., \underline{EG}) but a) that's probably not what you're after and b) it still won't look good since MathJax's output will be different enough for the underling not to match. For the CommonHTML, you could do something like \( \class{underline}{E}\class{underline}{G}\), but is messy and naturally can't work beyond simple cases (e.g., what to do with a fraction?)
This boils down to a fundamental question regarding math layout, i.e., how much should math layout be influenced by its surrounding context. One side of the argument would consider your case improper since it might change the meaning of the expression. Personally, I don't feel that way (resets are easy) but again there are obvious limitations.
In any case, for MathJax, it's currently mostly a technical limitation.
Regards,
Peter.