I am far from an expert on this so there are likely better ways. . .
As I understand it ST_Length() returns the length in the projection units. So using a ST_Length(ST_transform(geometry,*)) would need a * projection that is close to meters for the area of interest. If you are only dealing with a small region and don’t mind hard coding things then you could use the valid UTM projection for that area.
In my case, I needed to clean up the ways some anyway (for distances between junctions) and found the easiest way was to create a separate table/database for normally used for routing. It turns out that osm2pgrouting populates a number of fields including one that is the way length in meters.