"Several attempts to remove the animal from the rail were in vain," Malafeyev wrote on Facebook. "Because the dog strongly defended her from us."
So Malafeyev was forced to watch the same terrifying scene repeat itself: a train blaring into view and Panda pushing Lucy's head down just enough to avoid being hit.
"He warmed her for hours," Malafeyev added. "So she's not cold and put himself in danger every time."
Malafeyev, who often helps dogs in distress, was finally able to earn Panda's trust and get close enough to pick up Lucy from the tracks.
Of course, there was one condition.
Panda had to come along for the ride.