We study the synchronization behaviors of two indirectly coupled mechanical oscillators of different frequencies in a doublecavity optomechanical system. It is found that quantum synchronization is roughly vanishing though classical synchronization seems rather good when each cavity mode is driven by an external field in the absence of temporal modulations. By periodically modulating cavity detunings or driving amplitudes, however, it is possible to observe greatly enhanced quantum synchronization accompanied with nearly perfect classical synchronization. The level of quantum synchronization observed here is, in particular, much higher than that for two directly coupled mechanical oscillators. Note also that the modulation on cavity detunings is more appealing than that on driving amplitudes when the robustness of quantum synchronization is examined against the bath’s mean temperature or the oscillators’ frequency difference.