Quench-induced entanglement and relaxation dynamics in Luttinger liquids