I have had 2 Lionel Locos do something similar. The first was a 4-4-2 that I got with the Pennsyvania Flyer. The culprit was shoddy soldering. One of the leads that ran near the smoke unit had popped out, there was not enough solder to hold the wire in place.
The loco suffered another solder failure that took out the reverse unit card. All it would do was run in reverse. The engine was only about 13 months old when it finally failed. I still have it, and it presently sits in the “repair yard”, at the bottom of the priority list of repairs, below the completetion of my 221, and a prewar 1681E, and a few others.
The other was a Lionel Chessie GP-38-2. The reverse unit stopped working right after about 3 months. It would cycle alright, but in foward, it would not move, basically it was STALL-N-REVERSE-N-STALL.
Both of them are reverse unit card failures.
By the way, I took the 4-4-2 to the local Lionel Service Station, they wanted too much to repair it, and would not sell me the new card by itself.
The GP-38-2, I talked with Lionel Customer service about it, and they told me that despite it being new in box, it was an older item, so it was not covered. (The engine is from 2001, I bought it on 02 Dec 2006) I was told that it would be cheaper to order the new card and replace it than it would cost for shipping alone. Again, low on the repair list, the last 3 train shows I have been to did not have the reverse unit cards.
Bad solder joints do not always make themselves known during the short test run the train is put through, shipping, handling, running, and the occasional derailment will bring those to light.