This would not be done with a simple on/off switch. There would be a control interface between the Semi & trailer where everything is coordinated.Adding a motor to a trailer is simply unsafe. Here's why:
A trailer can become unstable if there is too little tongue weight on the trucks hitch. You can mitigate this dangerous situation by applying the trailers brakes if the driver is clear headed enough to do this, and do quickly enough. Applying only the trailer brakes will transfer weight from the trailer to the trucks hitch, temporarily applying the needed tongue weight to stabilize the truck and trailer.
If you add a motor to the trailer, with the thought of "pushing" or even providing a neutral drag affect, it will un-weight the hitch and create the dangerous scenario described above.
In the future trailers probably come standard with a lot of sensors and cameras (inside & outside) too. All monitored by Semi and truck headquarters.