Version tested: 0.17.52
Deconstruction planner will not remove rails under train, even if explicitly filtered for rails:
When a deconstruction planner is run over trains on rails, only the trains will be removed; any rails under a loco or wagon are not removed.
Presumably this is intentional, to avoid the need to have a filtered DP to remove trains without also removing track. Although this is inconsistent with Editor mode, where both trains and track are removed (to be exact: straight rails are removed in Editor, curved are not, which I believe is a bug.)
However, this is also the case when a Deconstruction Planner is used which is filtered to target rails, curved rails, locomotives, wagons. In this case it feels odd; I have a DP that is specifically filtering for rails, so it seems wrong that some rails are not removed.
I would suggest that when an explicitly filtered DP is used that is filtered on both trains and rails, and both trains and bare rails are selected, then all rails should be removed along with the trains.
In other words, the DP could behave similarly to how it treats tiles. A default DP will only include tiles if they are the only thing selected. Extending this concept to trains: if a DP area selects only a train, then the underlying rails are not included. But if a filtered planner is used that includes rails, and the area is expanded to select rails that do not have a train on them, then all the rails are included. This could even apply to all DPs, even without rails being filtered.
And/or, the removal of rails along with trains could be optionally enabled: either globally in Settings->Interface, or else as a new configurable in the DP itself.
Example: DP filtered to rails, curved rails, locos and cargo wagon, highlighting an area that includes trains and bare rails:
![Image](https://forums.factorio.com/images/ext/935a6b49e3e2be1f7e8b49d5cc52521f.png)
Result:
![Image](https://forums.factorio.com/images/ext/56cf7636e519fd33ae649e24d8269145.png)
The tooltip and DP markers correctly informs the player that not all rails will be removed. Nonetheless it's still a counter-intuitive result, with some rails removed and others not, despite the filters requesting all rails to be removed.