The phase-comparator II in the CD4047 phase-locked-loop circuit should do what you want.
According to this
Application Note discussing the circuit's Phase Comparator II on page 7:
"
If the signal-input frequency is higher than the comparator-input frequency, the p-MOS output driver is maintained on continuously.
If the signal-input frequency is lower than the comparator-input frequency, the n-MOS output driver is maintained on continuously."
The output thus is a digital signal indicating which input has the higher frequency.
That's the only part of the circuit you need to use (but tie the Inhibit input to ground).