After some testing, I came across a possible solution.
For the filter widget, here is a possible solution though not quite in the manner that you are looking for.
For the filter widget:
"Display features that match all of the filters"
- Create filter set for Layer B
- Choose "All of the following expressions in this set to be true"
- Set expression "Distcode" - "contains" - select all unique values
- "Ask for values" unchecked
- Set expression "SubdistName" - "is" - select unique values
- Create filter set for Layer A
- Choose "All of the following expressions in this set to be true"
- Set expression "Distcode" - "contains" - select all unique values
- "Ask for values" unchecked
- Set expression "DistName" - "is" - select unique values
The only other option for the filter widget (similar to above but simpler) is to add the "DistName" field to Layer B feature class and field calculate the corresponding name by joining the table for layer A to layer B. You can re-publish the layer and set the filter (similar to what was mentioned above) with the only difference for the expression is swapping out the "Distcode" for "DistName" by unique value and asking users to select a value. You can then set the "SubdistName" filter below to only allow for predefined values based on the previous filter.
As for Layer A, simply set it to filter all values that contain the district name and it should simply filter by default.