Federal regulations -- and, thus, railroad operating rules -- do not change in response to the time of day (or night), whether anyone is awake or asleep, whether there are or are not any highway vehicles approaching the crossing, or any other conditions. "Light whistling" is not provided for, and is a violation of railroad operating rules and federal regulations.
Even though it may seem harmless, and even courteous, it should never be done. There is an army of plaintiff attorneys hungry to win big on a grade crossing case. They all have "investigators". I have testified for the railroad in crossing death lawsuits where the attorney's investigator videotaped trains "light whistling" at that crossing. It had nothing to do with the subject of the lawsuit, but it did prove that the railroad was not always in compliance with requirements at that location. Juries are usually inclined to identify with the plaintiff when shown evidence like this.
Before the enactment of the federal regulation (around the year 2000), state laws and railroad operating rules governing road crossing bell and whistle warnings were quite adequate, and allowed a certain amount of discretion for the Engineer to use at night and when moving slowly. As is normal, though, when the congress, advised by the Federal Railroad Administration and National Transportation Safety Board, makes rules on how trains should be operated, what was simple has become more complicated and burdensome.
ADDENDUM, Monday, January 11: I just looked at this thread again, and, from what I wrote here, you can see that the subject is one of my "hot buttons" . I had to laugh at myself for sounding so parental. Kindly accept my apology for the somewhat stiff-necked and stern tone of this posting.