Yes, they both refer to cicada.
Most people use 知了 in both oral and written forms in mainland China. People almost never use 蝉 when they speak.
The reason cicada is called 知了 is because they make the noises which sound like they are saying (zhī liǎo... zhī liǎo... zhī liǎo...). Therefore, 知了 is also used to describe the sound cicada makes.
I'm not sure if one is more archaic than the other. As the word 知了 was used in classic Chinese literature 《月令七十二候集解》, which was written by 吳澄 in 元 dynasty (AD 1271–1368)