Yes, it is possible. Let α1 and α2 be the coefficients of linear expansion and l1 and l2 be the lengths of brass and steel rods respectively. Suppose that the temperature of the rod is increased by ΔT. Them, change in length of brass rod,
Δl1 = l1α1 ΔT
and change in the length of the steel rod,
Δl2 = l2α2 ΔT.
If the difference between the lengths of the two rods is to remain same then
Δl1 = Δl2
or, l1 α1 ΔT = l1 α2 ΔT
or, l1/l2 = α2/α1
Thus, the lengths of the two rods should be in the inverse ratio of their coefficients of linear expansion.