Sir, this is a recommended practice. The reason for flag exchange by station staff apart from an indication of line clear ahead(which the signals anyway make clear) is also an acknowledgement that everything appears visually okay with the train, there is no abnormal sounds from the axles indicating issues or no visible hot axles, no visible issues in the formation.
.
If its a crossing train that is what the flag exchange conveys. Likewise, The reason pointsmen and station master/staff stand on opposite sides of the P.Way is for a visual flag exchange...
more... while observing both sides of the formation, the red flag is kept ready for immediate display in case of any issues.