Samsung is my choice, for those needing service can you bring it to an authorized Samsung shop I guess depends on the volume they are fixing and the shop you are brinigng it to.
Sony HDTVs is basically rebadged Honai as Sony has sold all their HDTV plants in Mexico and Japan.
The last time I checked LN40C540 was a 2010 model and the Sony Bravia KDL40EX400 was the newer model with more features like room atmosphere auto adjust.
So the bottom line for me is price$$$, I really will accept the two brands, if you are going to use it for OTA then I would pick the Samsung since I experience their tuners are more sensitive than the Sony's.