Comparing the spectral lag of short and long gamma-ray bursts and its relation with the luminosity