Trademark right and patent right are different concepts. Trademark rights actually protect the "goodwill" of enterprises, while patent rights protect a product or a technical solution.
They protect different objects, and there is no necessary connection between infringement of trademark rights and infringement of patent rights. Moreover, when the trademark right or patent right is infringed, only the patentee or trademark owner has the right to defend rights. According to your description, the patent right and trademark right belong to different companies, and infringement of patent right or trademark right requires the two companies to defend their rights separately.