UV mapping is unsuitable for this as the scale is dependent on the size of the faces. There is no simple way (that I'm aware of) of determining the size of the actual face within the material to scale the texture appropriately.
The solution is to use Object coordinates - these are centered on the object origin but are the same scale for all objects - regardless of its size (provided the Scale has been applied).
However (as has been pointed out) Object coordinates do not allow the texture to be wrapped around your mesh. The solution to this is to use different materials for each orientation of faces. This way, the faces that are pointing along the X-axis can have a texture that is aligned with those faces, while those aligned along the Y-axis can have a texture that is aligned with those faces.
Add each of the materials to the mesh and, in Edit mode, select each set of faces and Assign the material to it. In this example I have created two materials - one coloured Red and the other Blue - to show how the materials have been assigned to opposite faces :
In my example I have two materials - one for the front and back faces and another for the side faces. If your mesh has faces at other angles then you should assign additional materials to those (eg, all faces at 45 degrees would be assigned a third material, those at, say, 30 degrees another, etc.).
Each material should then be set up identically but with a Mapping node set to orientate the texture as appropriate for that set of faces. For example, for those at the sides, the texture should be rotated 90 degrees around the X axis as shown.
Adjust the Mapping of each material to align the texture on the associated set of faces. For my second material I used the following rotation :
The bricks are now scaled the same, regardless of the size of the mesh/faces.
You may get discontinuity of the texture at the corners (see the edge of the smaller cube) as it changes between the different materials. You can adjust the Location Mapping values for each material (and potentially add further materials to allow some faces to be adjusted without affecting others at the same orientation) to offset the texture to reduce the discontinuity to acceptable levels.