That motor is from a Marx, probably a 999, a 2-4-2. Marx engines run best on Marx switches like the 1590 as the gear to the wheel rim will derail on most other including Lionel switches.
I had several Marx engines and they are one reason I went with 027 Marx 1590 switches, now 31 on my layout for 34 years. Other reasons are I had 4 already, they only cost about $10 a pair, they have no lights in controllers or switch to rob transformer power, they are easy to repair, they have a low profile, they work with Marx fat wheel engines and they are very reliable.
Marx train with 999 engine and cars.
10 Marx 1590 switches and my Wye. I painted them grey but most come as black with red solenoid cover.
Pictures of layout from write up on OGR form with index on page 1, post 1
https://ogrforum.com/...fties-era-027-layout
Charlie