This contribution presents a dual-frequency molecular clock with trapped HD+ ions based on the two-photon rotational transition (v,L)=(0,1)->(0,3) at 3.268 THz and the two-photon rovibrational transition (v,L)=(0,3)->(9,3) at 207.634 THz which are detected by photodissociation of the (v,L)=(9,3) state. The two-photon transition rates between hyperfine components of HD+ energy levels and the lightshifts are calculated with the two-photon operator formalism. Temporal dependences of the populations of trapped HD+ ions are described by a set of coupled rate equations. The two-photon transitions may be detected efficiently with resolutions at the 10-13 level. The comparison, with an accuracy estimated at the 10-12 level, between experimental frequencies of two-photon rotational and rovibrational transitions of selected HD+ and H2+ ions and the values derived from quantum electrodynamics calculations may be exploited to determine the Rydberg constant, the proton-to-electron and deuteron-to-proton mass ratios, the proton and the deuteron radii independently on previous results. Depending on possible issues of the proton radius puzzle, measurements of hydrogen molecular ion two-photon transitions may improve the determination of the proton-to-electron and deuteron-to-proton mass ratios beyond the 10-11 level.