This fix was mainlined a couple of months after I published this. You shouldn't need to build this module by hand any more.
https://github.com/torvalds/linux/blob/master/drivers/hid/hid-xiaomi.c
Fixes Mi Silent Mouse side buttons.
$ sudo apt install build-essential linux-headers-generic dkms
(If you use a non-generic kernel, you should install the headers for that. DKMS is optional.)
$ make
$ sudo make install
$ sudo dkms add .
$ sudo dkms install hid_mimouse/1.0
$ make uninstall
$ sudo dkms remove hid_mimouse/1.0 --all