The samurai were a semi-noble class of a very advanced society. The samurai were much more civilized than the Vikings did not fight to plunder to sweep everything in their path, they were fighting for a sense of loyalty to the daimyo, shogun, emperor. Their customs and education were more advanced
No offense, but a lot of this is romanticized western bullshit. For a long time, samurai were some of the most savage and sadistic bastards of modern human history. This goes all the way back to the mid Fujiwara period (10th centuryish), when the warrior clans first started asserting their power over the religious-based government to when the Shogunate finally took control during the Kemmu Restoration (early 14th).
During this time, Japan was in a state of constant civil war, where territory literally changed over night, night after night. They tried to maintain a pretense of some kind honor system based on held-over rules and principles dating back to the infusion of Zen Buddhism in the early 6th century, but nobody adhered to them. If you were a lieutenant, and it was in your best interest to stab your boss in the back, you did so--or better yet, you paid someone to do it (See: Go ninja! Go ninja! Go!)
And while, you're correct that their education and technology level was very high during most of the first millennium, there was a huge regression during this period, outside of a few apprenticed tradesmen and the monks--and of course the ruling class. Most of the country was dump as a post.
This was because Shintoism became the dominate religion of Zen Buddhism, which is basically just Confucian Taoism. And traditional Shinto
is indeed very icon/deity based and it does have an afterlife.
Anyways, all this infighting for over two and a half centuries. The reason why the never became conquerors was because they were too busy killing themselves.
Finally, everyone got tired of it and resources became too scares, so they were forced into unification early-mid 17th century and the start of the Tokugawa period. Which is were all the celebrated samurai stuff comes from. The big reason for this is because the government because pushing the "ways" almost out of necessity. Because, on top of the problems the in-fighting caused, they now had the Portuguese and Danes trying to make a foothold. So they had to find away to quickly get the masses up to speed. So they started trying to reinsert Zen and the old ways of learning. Essentially sort of hodgepodge of Zen and Shinto arose. A new set of mores and precepts arose and Bushido was the byproduct of this.
And this is still basically how it is now. Almost all Japanese identify as Shinto and better than 3/4th identify as Buddhists. But really everyone is both and neither at the same time. And your run-of-the-mill shrine--the ones the kids all go to in the penultimate episode of a slice of life anime--is basically just a modern reflection of this mishmash. It's not an active worshiping religion (even though it has "gods") but more of a passive philosophy.
However, all this change wasn't enough and, even by the Revolutionary War, the West as pretty much asserted itself into the culture. So really the Western idyllic samurai thing only lasted about 80 years or so. Furthermore, by the beginning of the 1800s, the Western influence had caused corruption to run amok in the high echelons of the government, which, in turn, inevitably lead to the Meiji Revolution.
And here's the thing: everything I just wrote reads a lot closer to Klingons than any Andorian I know. Hell, if you included the relaunch and/or STO as canon, then the chronology matches Klingon history pretty closely.