The gear and switch is Lionel. The driveshaft looks like a Stock Drive Parts item. The Lionel driveshaft has a double U joint with plastic spyders. There is a less expensive and even stronger U joint that can be made with a pair of 4mm U joints found on eBay. If you plan to do this yourself, the metal U joints have to be shortened. The SDP shaft can be used as is. They both work. I have used them both.
https://www.ebay.com/itm/2pcs-...7:g:6uoAAOSwa-dWssbp
Pete