The movie ends with a shot of the cemetery in the peasant village: farmers' graves down below and the four graves of the samurai above them. The social standing is obvious; the samurai's graves are more prominent and we get the feeling that their deaths meant more as a result (probably because their swords are stuck into the top).
As an image, it's both grim and weirdly comforting, at least to Japanese sensibilities. The grimness is self-evident. Even though the bandits have been defeated, there's a price to pay and Kurosawa wants to leave us with a reminder of the cost rather than enjoying the victory. So instead of fading out with the happy peasants, we get a shot of the guys who died to make them happy. We can contemplate the tragedy of their deaths as we make our way out of the theater.
At the same time, there's something weirdly peaceful about those graves. For one, it demonstrates that some aspects of Japanese culture remain intact. Seven Samurai revels in showing us how traditional Japanese castes have fallen away, and how their dearly held values have had to change in the face of inflexible reality.
It's a bitter pill to swallow, but here, at the end of it all, there's some sense that those boundaries remain intact. The samurai do receive a higher honor than the peasants. They died to defend the greater collective, as bushido dictates they do, and their bravery marks them as members of a higher class that the farmers who (let's face it) shivered and whined their way to victory. It's not an entirely comfortable image because they're dead, but at least it demonstrates that the ideals they died for haven't completely faded from the landscape.
That makes the image a nice little summation of the movie as a whole. Things end and things change, but you get some good thrown in with the bad, and sometimes, the principles you thought were gone forever can still find expression. It's a downer, for sure, but at least it leaves you willing to go on in the face of the insurmountable.