You can use the standard artist's perspective alignment system.
- find the horizon in the photograph. (preferably on an enlarged photocopy :^) Draw this line in.
- hopefully your subject will have recognisable vertical and horizontal lines. Check that the vertical lines are vertical to the page and at right angles to the horizon line. If the verticals are not at right angles to the horizon then you have a double correction to make to the scale drawing.
- Extend the identifiable horizontal lines out to the horizon line. For a rectangular building or piece of rolling stock these lines should intersect the horizon at two points, one to the left and one to the right of the center. If not, then you've almost certainly done or got something wrong.
- Now pick something that you know the size of. (eg a door) Measure the picture dimension - you now have a ratio prototype/photo. You can measure up the line of the door to calculate the height of the wall. (provided the vertical lines are parallel)
- Finding a length that recedes towards the horizon is more difficult. An entirely rectangular wall is about the only way to calculate this, but if it doesn't exist, you can construct one on your paper through those extended lines. You will know the front corner height, the door and wall height (near the middle), and the rear corner height. These may well be your perspective construction lines rather than the object itself.
- If your maths isn't university geometry level then you can divide the length of the wall into rectangles in proportion to the height. (the ratio of height to length has to remain constant for straight lines :-)
If a photograph of (say) a tall building is taken from street foot path level, the vertical lines will converge towards the top. Then you have a more complex mathematical problem!