domestically the original Trek films were comfortably beating all the Moore/Dalton Bonds (& NSNA) throughout the late 70s/80s (yes even TFF)
the TNG movies easily lost out to the Brosnan movies throughout the 90s/early 00s.
then the JJ films totally beat the first two Craigs & Spectre (and STB is still comparable) but no where near Skyfall.
overseas however, the tables are completely turned in Bonds favour.
Domestic is sometimes competetive. But worldwide Bond always beats Star Trek. That's kind of important if you remember Bond is not an American franchise.