Boolean union with overlapping faces
The boolean modifier has two modes, 'Carve' and 'BMesh' (under the box for the second object)
A quick test shows for me that if I use 'BMesh', internal edges and faces are preserved, while with 'Carve', they are removed.