Good explanation here
https://www.youtube.com/watch?v=otCbHnwZ-Ig
and
https://www.youtube.com/watch?v=20hlvWWMvoM&t=34s
As your gear is bust, looks like you will need to undo the motor and move it about to disconnect the drive shafts. If you can manage that maybe you can find something to put in the end of the shaft and turn them by hand to get them to release or get a molegrip on their ends ant get them turning. Reckon they will have less resistance to turning if disconnected from the gearbox.