Even so the cable is the most likely problem. However, it could also be a Logic Board failure or even a Trackpad failure. I have encountered several incidents with our organization's laptops of this vintage where the Keyboard would work at the login screen, but not after logging in. And I've seen it the other way around where the Keyboard won't work to log in, but works fine after logging in. In some of those cases I had to replace the Top Case/Keyboard Assembly, while in others I had to replace the Logic Board itself. I've even encountered issues where the special startup keys were not properly registering (PRAM Reset, Recovery Mode), yet the keys all worked properly to log in and after logging in.
Part of the problem is on this model... if the Trackpad is not working, then it will prevent the built-in Keyboard from working as well. Plus on this model there are two ways of an OS to access the built-in Keyboard & trackpad...one mode may work, but not the other mode. The mode being used before logging in may be using the "USB mode" while after logging in it will use "SPI" mode.
How does an external keyboard & mouse work? If they have no issues, then it indicates a hardware issue.
Like I said before, the Trackpad Cable is the easiest & least expensive repair possible which may resolve the problem.
These newer Macs don't always behave like you would expect with older models. In fact much of my troubleshooting with these newer models has to abandon old methods and assumptions & learn new tricks & methods of diagnosis.
Edit: The Trackpad will prevent the Keyboard from working even though they each have their own direct cable to the Logic Board which doesn't make much sense, but it is what I have observed if the Trackpad is disconnected.