To what extent does China control Hong Kong's highest courts and ordinary courts? Some people have suggested that the chief executive of Hong Kong needs to be approved by China and thus it has some level of control over him; however true that might be, the next natural question is does it apply to the courts in Hong Kong and are there avenues through which China can exert its influence over them?
By far, Hong Kong's judiciary seems mostly independent.
Hong Kong's judiciary have ruled both for and against the government, and there is no clear political trend that can be observed from those rulings. Both the Hong Kong government and the Central People's Government's Hong Kong Liaison Office, as well as pan-democratic legislators and activists, have criticized or complained about Hong Kong's judiciary, but only seldomly so.
Therefore, it is not clear to me that Hong Kong's judiciary is "controlled" by either faction, and surely not by Beijing.
It is well-known that barristers in Hong Kong (the community from which most judges are appointed) generally have pan-democratic political leanings, but most of them generally support the Basic Law, so they do not have a particularly strong incentive or tendency to depart from the text and spirit of the laws.