You are confusing cells with batteries. A battery is a collection of cells. This difference is rarely important and so few people ever make it. In this context is matters as a EV has many small cells in the battery. You can put those cells anywhere they fit. You can't split an engine up like that. Thus while the battery itself needs more volume and weight than an engine (or at least that is the claim, depending on range desired this might or might not be true), you can put them in empty space where an engine cannot fit.
Can you really though? For EVs they're all using the classic cylindrical shape as far as I've seen.