If I understand your meaning, you want to make corridoors with walls, floor and ceiling.
You wouldn't use cubes to walk through, ie a single cube wouldn't make up the floor, ceiling and walls of the corridoor.
What you makes the walls from all depends on what the maze looks like.
In both examples, the floor can be made from a single plane or you can use an individual plane for each square in the grid. The same will be true for the ceiling.
I would say the option on left is easier to code as you don't need to worry about the orientation of the cube but it does generate a lot of unnecessary polygons which could affect performance.
The other way to do the version on the left is to create planes for the wall between the red and green squares but you have to orientate the planes to face into the corridoor.
The option of the right give less polygons but require a bit more coding as the plans would need to be orientated in the correct direction. The problem here is that the planes can only been seen from one side. The back face is invisible (test this by making a plane and just rotating it and you'll see what I mean). This also effects the collision detection as it only detects collision on the front of a polygon not it's back face. You might have to create each wall using two planes back to back.
In both case, the floor/ceiling can be made from a single plane covering the whole of the maze or you can use individual planes for each square. The latter gives allowance to have many different floor textures, possibly making it look more visually interesting.
Hope all that makes sense.