Loading cargo from or to trains can be done electrically. The movie shows the principle of operation. Building instructions are split into two parts. First is the module for loading on cargo. Second is for loading off cargo.
Movie to see how it works
Building instructions for loader
Building instructions for unloader
Have a lot of fun.