We investigate ballistic thermal transport at low temperatures in graphene and phosphorene nanoribbons (PNRS) modulated with a double-cavity quantum structure. A comparative analysis for thermal transport in these two kinds of nanomaterials is made. The results show that the thermal conductance in PNRS is greater than that in graphene nanoribbons (GNRS). The ratio kG/kP (kG is the thermal conductivity in GNRS and kP is the thermal conductivity in PNRS) decreases with lower temperature or for narrower nanoribbons, and increases with higher temperature or for wider nanoribbons. The greater thermal conductance and thermal conductivity in PNRS originate from the lower cutoff frequencies of the acoustic modes.