Hi Leandro,
I had a similar issue.
You'll have to get down so that the rails are at eye level. Sometimes it is hard to detect where exactly it is coming from, but if you what closely, you should see the spark. You could even watch for it in dim lighting. Once you see where the spark is happening, mark it or put an object next to it and inspect that area. If this has been happening for a while, there should be sign of arcing on a rail.
In my case, it was an O-72 and an O-60 FasTrack switch that didn't diesels with six wheel trucks. They would make contact with the center rail just past the molded in plastic on the switch. I added a piece of black electrical tape and all is fine...the tape was added about four years ago and hasn't lifted yet.
Good luck.
Here is a photo showing where I added tape...this is an 0-72 switch...