In addition to the raster solution I provided, here's a vector solution.
The first thing I did was to convert the vertices of the DEM1 and DEM2 lines to points. To convert to points, you can use Feature Vertices to Points, or if you don't have an Advanced licence, you can use the Feature Class to Points tool, or create your own arcpy solution.
In the below image, DEM1 is red and DEM2 is green. The topo line is blue.

Next, in your points layer, create a field to store distance. This will hold the distance from the point to the Topo line. You can use the Near tool, or if you don't have the Advanced license, you can use arcpy.
I used arcpy, which looked something like this:
First get the geometry of the topo line ( sr
is your spatial reference - whatever coordinate system you're using).
with arcpy.da.SearchCursor("Topo_Line", "SHAPE@", spatial_reference = sr) as sTopoCur:
for row in sTopoCur:
topoGeom = row[0]
Then calculate the distance from each point to the topoline.
with arcpy.da.UpdateCursor("DEM1_Points",["SHAPE@X","SHAPE@Y","Distance"], sr) as uCur:
for row in uCur:
thePoint = arcpy.Point(row[0],row[1])
thePointGeom = arcpy.PointGeometry(thePoint,sr)
row[2] = thePointGeom.distanceTo(topoGeom)
uCur.updateRow(row)
Repeat again for DEM2_Points.
The results can be seen in the attribute table:

Right clicking on the Distance field name in the attribute table, click on Statistics...

You can see how the point distances differ by comparing the statistics for each of them:
DEM1 Points:

DEM2 Points:

You can see that DEM1 Points have a smaller mean, which is expected since it follows the topo line more closely.
+-------------+----------+------------+------------+--------------------+
| TableName | Minimum | Maximum | Mean | Standard Deviation |
+-------------+----------+------------+------------+--------------------+
| DEM1_Points | 0.000001 | 110.073997 | 25.955782 | 38.645082 |
+-------------+----------+------------+------------+--------------------+
| DEM2_Points | 0.000094 | 310.643433 | 129.651896 | 72.359374 |
+-------------+----------+------------+------------+--------------------+
The results are different than the raster solution because we're looking at distance of vertices to the topo line, rather than the entire line to the topo line. However, overall, both methods result in showing that DEM1 line is a better fit.