I have a very similar problem. After waking up my MacBook Pro 13” 2019 (with latest Catalina) the keyboard and trackpad need around 10 seconds to work.
I have noticed that if the WiFi is OFF and I put my Mac to sleep it wakes up without issues. But if WiFi is ON and I close the lid for at least 1 minute - keyboard and trackpad are not responding for around 10 seconds. Tapping ESC key on touchbar has some effect - the light changes on touchbar. But it doesn’t do anything more than that.
I have tried resetting SMC and PRAM. No change.
Another thing - tried Recovery Mode and after closing lid there - keyboard and trackpad work.
One Apple advisor told me it’s probably not a hardware issue and reinstalling macOS will help. But I just spent 2 days reinstalling because of another bug (Apple Music not working) and not willing to lose more days.