A filter-track that can be put in a train station. It recieves 3 signals as input, if the signal is:
True, do nothing.
False, delete contents.
Conflict, do nothing.
Shape, do nothing if shape matches, else delete contents.
Paint, do nothing if paint matches, else delete contents.
The signal inputs could either be on a space platform, or through a global transmitter/reciever signal through an UI on the Train Filter.
Alternatively, instead of deleting the contents, it might instead take out the contents, i.e. the filter might work as a smart Unloader.

=> better suggestion … with the same results …
Since it should be possible to have many different containers / packages on any wagon level
so the alternative i suggest is the loader / unloader should have a wire enabled at the platform side on each level … there should be a input wire and output wire … the loader/unloader sends the shapez/fluid in the currently loading / unloading on the output wire ( in conflict reports the dominit shape/fluid ) and the input wire accepts a Signal to Flush {probably a 1 means empty snice null and 0 would equate to no action ] the currently loading /unloading container - also the same line should be able to adjust the semephore (Stop ) telling the train not to stop there or only trains of colour sent stop there