Some internet research reveals that brass has a thermal expansion coefficient about 50% more than that of iron. This means that brass expands and contracts more than iron does, for the same temperature change. Once the iron ring has cooled and hugged the cylinder, the ring and cylinder are in intimate contact and undergo the same temperature changes. If the system is heated, the iron expands, but the brass cylinder expands by a greater factor and the two remain securely attached. It is possible that extreme cooling can separate them, because the brass cylinder will shrink more than the hole does, but it would be difficult.