Kali, I can see how this whole thing is confusing for someone not familiar with US procedures.

Only certain railroads use flashing ditch lights, for others they are simply extra headlights. CSX and NS use flashing ditch lights, as well as Amtrak and some shortlines. Ditch lights flash only when the horn is sounded on locomotives equipped with flashing ditch lights, therefore a locomotive can be ringing its bell, but the lights stay solid, however even blowing a "shave and a haircut" at a railfan on the horn will trigger flashing ditch lights, any slight touch of the horn. I believe CSX/NS have a rule stating none of their locomotives without flashing ditch lights should pass a crossing at over 20 mph, but I'm not sure. Ditch lights can also be manually activated on some locomotives via a toggle switch labled "crossing lights". Hope this helps, this is based on my observations as a CSX railfan. Also, bells are to be used at crossings, stations, when in a locomotive terminal area, servicing area, some yards, interlockings (back when they had towers), and many locomotive's bells are hooked up to the horn, when the horn is sounded it activates a bell and/or ditch lights.