Phase transitions in dissipative Josephson chains