A lawyer for Trump named Consovoy said in court that Trump was immune from prosecution even if he shot someone in the street. If Trump killed 100 House Dems, then the Democrats would certainly no longer control the House.
This is technically an open question, but there is a general consensus that Consovoy's argument is unprecedented and unsupportable.
If the president can be dragged into civil litigation over private matters in the middle of his presidency, Clinton v. Jones, 520 U.S. 681 (1997), it seems unlikely that the courts would give him a pass on prosecution for a midterm murderous rampage.
If Consovoy is right, though, the answer would have to be that yes, Trump could avoid prosecution.
Posing the question that way sort of helps to highlight the problem with Consovoy's theory. As I understand it, Consovoy's argument is that impeachment is the only remedy for crimes committed by a president. But if the president can just kill of Congress, there's no one left to impeach him, leaving the country with no way to remove him.
So again, the answer is almost certainly no.