Both the keyboard and trackpad signals travel to the logic board over the one cable assembly [product|IF188-150] so it’s worth the expense to replace it first.
But before we do that how does the battery look? Compare it to the images in this guide [guide|142559] as a puffed up battery can cause problems with the cable.
Was someone inside before this happened? One other possibility is a damaged logic board connector so when you take the cable off really inspect the contact pins didn’t get damaged on the board side and I would also check the cable end side as well.