Stack two of the bricks and place the third alongside. Now you’ve identified the corners of an invisible fourth brick, whose diagonal you can measure directly with the ruler.
(Bonus: If the bricks’ edges and face diagonals all have integer lengths, and you find that the interior diagonal is an integer as well, you’ll have solved an open problem in mathematics.)
01/03/2021 UPDATE: Reader Paul-Georg Becker points out that the task can be accomplished with two bricks and a ruler: