My USB Apple Keyboard stopped working after upgrading to Sierra
Based on the Apple forums, people have had this similar problem since Yosemite up to Sierra. While there has been no official reason by Apple and many comments have went unanswered on Apple's website.  

Here is what people have reported to have work. (whether it makes sense or not, this is in fact what people have confirmed to be working. (same situation identically for some, other keyboards work but not the USB Apple Keyboard.

These are 2 things that have been confirmed to work on iMac 2015 models.


  1) Plugging the keyboard into a USB hub, then the hub into the iMac.
  
  2) Plugging the keyboard into any USB extension cable, then the cable
  into the iMac.


Referrence: https://discussions.apple.com/thread/7501433?tstart=0