I am confused with regards to the unit. You wrote cm cubic inches. So, I'll just use cubic unit.
Given:
Volume of rectangular pyramid is 125 cubic unit
Volume of rectangular pyramid = (length width height) ÷ 3
Volume of rectangular prism = length width height
The main difference between the two volumes is the present of 3.
Volume of rectangular prism = Volume of rectangular pyramid 3
V = 125 cubic unit 3 = 375 cubic unit