The following is a 4-step approach with standard QGIS functions which might get what you want. Here's the TLDR:
- Buffer the fences
- Split the buffers along all boundaries
- Extract the overlap areas
- Remove the parts of the river that fall within the overlaps
Here's a more detailed explanation:
1. Buffering the fences
"Vector --> Geoprocessing Tools --> Buffer(s)..." using a 20 m buffer distance.
2. Splitting the buffers along boundaries
In the Processing Toolbox ("Processing --> Toolbox" or Ctrl+Alt+T), find the GRASS Command "v.clean". Select bpol as the Cleaning tool.
This should result in a layer in which the areas where the buffer zones overlap are duplicated, while the buffer areas are not. In effect, the buffer overlaps show you where fences from both sides are within 20 m.
3. Extracting the overlapping areas
In the DB Manager tool ("Database --> DB Manager --> DB Manager") we select our "cleaned" layer as a QGIS Layer and open the SQL window. ("Virtual Layers --> QGIS layers --> [our cleaned buffer layer]" and then the "SQL window" button in the upper left.
Using the following SQL query we select only the polygons that are identical to another polygon in the same layer, i.e. the buffer overlaps. Note: this requires a unique id field on the buffer polygons (which could be inherited from the fence lines).
SELECT a.id, a.geometry
FROM Cleaned a, Cleaned b
WHERE ST_EQUALS(a.geometry, b.geometry) AND a.id != b.id
Hit "Execute (F5)" and the check the "Load as new layer" box followed by the "Load now!" button in the lower right.
4. Removing the guarded river sections
"Vector --> Geoprocessing Tools --> Difference..." using the rivers as the Input vector layer and the QueryLayer we loaded in step 3 as the Difference layer.
This image shows how the buffer overlaps can identify the guarded parts of the rivers:

NOTE! This method checks for multiple guarding fences rather than fences on both sides
The caveat of this method is that it finds river sections that are guarded by at most one fence line rather than sections that are guarded on both sides. If a single fence line were to guard both sides of a river, it would be treated as guarded by one fence and thus be included. Conversely, if two fence lines on the same side of a river section are both within 20 m, the river section would be excluded for being guarded by two or more fences.
I guess depending on your data this approach may or may not be acceptable.