IMO, installing watchtowers to track lion's movements near the tracks, installation of LED floodlights near the tracks, fencing off the entire 90 km LMO - PIVV stretch, permanently restricting the speed of trains to 30 - 40 kmph, placing the trackers near tracks who can alert the SM of the nearby station on spotting the lion might help to save these felines.
The reason for lions coming on the tracks is despite fencing done on a few stretches on the route and keys of the fence given to farmers by the forest dept. (as farms are located on both the side of tracks), on a few occasions, farmers forget to lock the doors of fences which results in the entering of...
more... cattle and wild animals including lions inside these farms.
Another reason is these incidents are seen occurring from August to Feb time of the year. In monsoons, grass grows near the railway track and cattle come for grazing near tracks, so the lions follow them near these tracks.
The grass is wet in the rain so lions feel cold on the grass and the height of the track is higher, so they sit on the track. This benefits them in 2 ways - they have a clear view of nearby surroundings and a higher height of tracks and keep themselves away from flies and mosquitoes as the wind blows over. Water availability and Cotton cultivation ensure that lions get a nearby easy shelter.
Also, the forest dept. say that lions are moving from Gir to Amreli and Bhavnagar districts due to food search. Plus it is observed by dept that the younger and less experienced lions who have recently moved to this region are the ones who are prone to get run over by trains. Those lions who have been present in this region for a long time know about these tracks so they are usually saved from accidents.
So as you mentioned, AI won't help to detect the feline's movements unlike an elephant's.