There's no difference in the trains, the difference is in the track.
At the very bacic level, from the traditional tubular track viewpoint, O27 track is lighter and the curves are sharper, making a 27" diameter circle. Hence the name "O27."
"O" gauge track is heavier material, a little taller and a slightly larger circle, being 31" in diameter.
The track gauge (width between the rails) is the same. The limiting factor of O27 is that some locomotives that will run on O31 curves will not run or not run well on O27 curves.
Rusty