I mean, it’s as simple as two gears and a motor mount.
A small motor can directly drive the gold colored gear. The silver one is integrated into the pivoting truck.
Like in the above photo, the red portion would have the silver gear integrated into it.

