We propose and analyze the use of hybrid microwave cavities as quantum heat engines. A possible realization consists of two macroscopically separated quantum-dot conductors coupled capacitively to the fundamental mode of a microwave cavity. We demonstrate that an electrical current can be induced in one conductor through cavity-mediated processes by heating up the other conductor. The heat engine can reach Carnot efficiency with optimal conversion of heat to work. When the system delivers the maximum power, the efficiency can be a large fraction of the Carnot efficiency. The heat engine functions even with moderate electronic relaxation and dephasing in the quantum dots. We provide detailed estimates for the electrical current and output power using realistic parameters.