This is what is known as a “lock mule” on the causeway of one of the Panama Canal’s locks. These devices are tied to the ship on both sides as it approaches the lock and guides the heavy behemoths through the set of locks via rails. They are really electric locomotives that pull the ships forward through the locks, keeping them off the walls.
These innovative machines have run on electricity since the locks were built. The electricity is generated by the dam that helped to create the Gatun Lake which is a major part of the canal and the driving force behind the whole canal system.
According to pancanal.com, there have been several generations of “mules,” but these newest versions weigh in at 50 tons a piece and are capable of moving 311.8 kilonewtons at 4.8 kilometers per hour.