I suggest you compile the X11 version of Lyx and run that under
X11. Then you will get the desired behavior.
There is no "focus follows mouse" for non-X11 apps.
You can turn it on for Terminal, with
defaults write com.apple.Terminal AutoFocus -bool True
(I think). Then you get focus-follows-mouse between X11 apps and
Terminal, or between Terminal windows. Focus-follows-mouse doesn't
work for arbitrary Aqua apps because then there'd be no way to move
the mouse to the menu bar without accidentally switching apps.