So here’s something weird. My Macbook Pro (Retina, 13 inch, Early 2015) has started displaying the same problem. The keyboard and trackpad frequently become non-responsive. 4-5 times out of 10, a restart would fix it. Of late, on restarting, the computer would complain that it couldn’t detect any keyboard/mouse and start looking for a wireless one.
Well, when I connected a wireless keyboard+mouse and started the computer, not only did the wireless keyboard+mouse work, but the native keyboard and trackpad worked too! So this makes me suspect that it is a software, rather than a hardware issue… But how could it be a software issue when I haven’t performed any OS update in a long time?
Anyway, here are two more additional pieces of info in case its helpful. One, on once occasion, the native keyboard and trackpad again stopped responding even when the wireless keyboard+mouse were connected. Two, once when I unplugged the wireless keyboard+mouse, the native keyboard and trackpad continued working for a while before freezing again.
Hope this helps. Do let me know if anyone has found a solution for this