This would be an interesting battle
Pirates would have the power of barbaric hoards.
Robots have super-strength and xray vision
Ninjas can use stealth and cool nija weapons of doom
Dinos would eat anything they see. Including themselves
Now, lets think about it. The Dinosaurs are the most barbaric of all, and the'd probably end up eating themselves before the aliens even deposited them on the planet. So that gets rid of the dinosaurs.
The Robots would short circuit in the water and would get sand stuck in their gears, like Jim said. Unless they're Terminators. Then they'll pwn.
The pirates would be cursing and spend their whole time making threatening gestures at the Ninjas, who in the meantime would use telepathy to think out a super awesome plan to kill the pirates using poison tipped knives and ninja death stars.
So basically, that leaves the Ninjas, unlesss the Terminators survived. If the Terminators survived, then they'd eat the Ninja swords. The Ninjas would then run around, hiding as Skynet bombed the world with an array of Nukes, and the Terminators would build a mechanical empire, using humans as a form of energy in giant power plants whilst they remain plugged into a giant computer. Then, the Ninjas would jump out of their hiding places, bust out their Energy Ki attacks and explodify the world.
The end. Damn, I should write a story.