Maybe you could build a small roach motel structure or 3D print one, then limit how the roaches reach the bait such that their heads are positioned in a very specific alignment, and install a laser module with the necessary heat management and optics to position and focus the beam right into the roaches' little heads, and then install the worlds most sensitive strain gauge as a pressure plate to cycle the laser pulses. You'd also need a tiny servo to remove the roach carcass after it's blasted or else the trap would only work once. But, then at that rate, you might as well just have the servo squish the roach and remove it with one movement and reduce the risk of the thing setting itself on fire while no one is around. At that rate, you could just purchase a regular roach motel and both save yourself the trouble and also effectively remove more roaches.
Or, if you don't care about safety or effectiveness and don't have the patience to align things at the 10s of microns precision level, you could attach the bait to a small string, which pulls a tiny lever that releases a marble that rolls down a ramp and hits a slightly larger lever that releases a green plastic army man with a pre-packed parachute from a fair height, who is holding a firecracker, such that he lands on a pressure plate near the roach that activates a laser that ignites the fuse on the firecracker. If the roach hasn't run away by the time the firecracker goes off, it might seriously maim the roach, to the point that the affected roach will have to file for disability and be supported by the other roaches in their greater roach society, and that social pressure might encourage the roaches to flee to a neighbouring house that has a more productive culture with fewer "freeloaders."