Kindly go through the following Microsoft reference article:
Troubleshoot Surface Pro Keyboard or Type Cover
Shut down Surface >Hold Volume Up >Press Power once > Release Power but keep holding Volume Up
This opens UEFI.
Now test:
Does the physical keyboard work there?
Can you use arrow keys or trackpad?
If keyboard works in UEFI → likely Windows/driver problem. If it does NOT work in UEFI → likely hardware/Type Cover/connector issue.