Thankfully, I've never had any lightning strikes here.
However, from my 'Boys' Own Book of...' on the subject, the likelihood of a 'primary' strike directly to the track would be pretty remote, especially as there are potentially easier paths to ground around - your house/outbuildings for example. However, the chance of a 'secondary' or 'splash' strike - ie lightning hitting the tracks having first hit an adjacent structure might be higher. In which case, then possibly moving your delicate electronics off the metal tracks might help.
Having said that, lightning strikes are known to have other tricks up their sleeves, including an EMP which although not necessarily huge, might if the strike is close enough be sufficient to fry said chips anyway, even in a loco sitting on a wooden shelf. If your storage area, on the other hand, was a metal shed - that would give the best protection as it acts as a 'Faraday cage'. For this very reason, I am told, the safest place to be in a thunderstorm is in a car or otherwise in some other metal building - not that I would like to try any of this, you understand!
Fat Controller of the S&CGR