The only engines I would hesitate buying would be PS1 engines, because of the possibility that the chip(s) is/are scrambled due to a low battery. But if the seller says it's good or you can verify that it runs prior to purchasing, then the battery in the PS1 can be replaced with a BCR. If buying from a LHS or at a show I'd get them to run it first. All the Greenberg shows I've been to in the last 5 years or so have had test tracks where someone will test run your engines.
Electronics in general usually suffer from what is called "Infant Mortality":
One characteristic of modern semiconductor electronic equipment is something called infant mortality. The failure rate of new electronic equipment is generally very low. However, if the equipment is going to fail, it is likely to do so within the first few hundred hours of operation. Failure within this time period is called an infant mortality failure and is usually caused by a flaw in a semiconductor or other electronic component. Simply having the equipment power turned on is often enough to cause this type of failure to occur. If the equipment does not fail in the first few hundred hours of operation, then it will probably provide many years of trouble free operation.
Read here:
http://www.cvarc.org/tech/burnin.html
I've 3 PS2 engines that are pre-2005 and all work well with original batteries still in them. I do have a RailKing RS3 with Locosound that, below 50 degrees, has to warm up before I can change direction. I found that out when I had my layout in the garage. After the heater warmed the room enough the engine ran fine. Since I've moved the layout to the upstairs in my house I have not had a problem.
But there's always a possibility. If the previous owner had had lousy trackwork resulting in numerous derailments, I'd suspect some possible electronics failure is inevitable. I read comments on the forum about folks having trouble with their engines and wonder what REALLY happened. I knew a guy that was always complaining about his boat. I found out later that he just couldn't leave things alone and was always fooling with the engine, go figure