I've read of ninja being used as traditional troops at times and being very effective in that role. I would have to say that I favor the samurai though. I guess I'm more into the honorable knight thing. With that said if challenged to a fight by either I would without shame run the other way! LOL!
Ninja would win hands down. The ninja were the elite warrior in Japan like our modern day spec ops. They studied the same combat tactics as the samurai and improved upon them. To begin with, most ninja clans were samurai - the only exception of course being the Momochi Clan. The ninja trained in battlefield tactics as well as espionage. There are even schools of ninjutsu today that teach how to fight wearing armor such as Kukishinden Ryu and Takagi Yoshin Ryu. Ninja trained from the age of three in martial arts designed to defeat other warriors like the samurai. Other than the katana, yari, and naginata, the ninja also used staffs, guns, and explosives.
Samurai have always been my preference, even going back to Samurai Pizza Cats and Teenage Mutant Ninja Turtles. I like the code of honor, and symbolism behind the Samurai. Not to mention the classic film Seven Samurai, which is a great Japanese movie.