Yes they are, guide rods and spring have nothing to do with it.
Although some gen3 barrels have a smaller socket for the smallet gen3 rod (some gen 3 have the same notch as gen 4), the gen 4 rod will fit because the rod does not sit in the notch anyway and it always moves out regardless of the notch size.
I have both gen 3 ans gen 4 glock and the barrels are totally interchangeable.
Cheers