This is what I found about the same problem, just solving it with a new cable:
I had this problem twice. The problem for me was that the thin cable that runs from the trackpad control board over the battery to the connector on the mainboard. The 2015 model MacBook Pro cable is (arguably) slightly longer than it needs to be to get over the battery, and as a consequence the cable gets crimped up at both ends and over time fails. When it fails (usually intermittently at first and then permanently) both keyboard and trackpad are disabled as input devices and you hit the problems you are describing. The fix is easy - google "MacBook Pro 2015 trackpad cable" and buy a replacement - they cost about $10-15 on Amazon - whip the back off your laptop and swap the cable and it should all work perfectly again. You'll need the right combination of screwdrivers to open the back and take off the cable cover above the connection to the main board, and remember to disconnect the battery whilst you do the repair to minimise the chances of frying things. If you need more help, follow the first part of the ifixit guide to replacing your trackpad. But you dont need to replace the trackpad - just the cheap cable connector (as I learnt second time around - the first time this happened I wasted money on a new trackpad as well - its not necessary.