I was wondering if derailleur and brake housings are the same
No. Brake housing is spiral wound to take the loading braking places on it but it does compress slightly. Index shifting is degraded by this, so non-compressable housing made of strands that run parallel to the cable axis is used. This cable cannot take heavy loading, it is liable to split under load, so is unsuitable for brake housing.
If you use friction shifting then spiral wound housing can be used for the shift housing.
To build on ^, compression less housing should be used for shifters as to not move the RD/FD positions whenever you turn your bar, etc.
Also, am I mistaken or are the IDs of the two types of housing different?
That's a question that has a moving answer.
Way back when they used to be the same.
When index shifting systems came along shifters required compressionless housing with the reinforcing wires running parallel, or nearly parallel to the inner cable. Brake housing used more spiral wound reinforcing wires to keep the greater cable tension from breaking out. During this era many shift housings were only 4mm in diameter but that's not a reliable indication because 5mm shift housing was also available.
Today cable activated disc brakes have ushered in the era of compressionless brake/shifter housing. In other words, if you get the right stuff, you can use the same cable housing for both brakes and shifters again.