I read a book (I remember vivid illustrations on each page) in the early / mid-80's. Plot line is along the lines of landed on a planet and a machine (I think was called RAAG or RAG?) then went and built a railway line across the landscape.
This railway line then cut through alien cities / civilizations. They got on the train and travelled across the landscape. Locals blocked the line with a barricade and long metal spike to impale anything travelling along the line.
I then remember that they somehow got past and ended up getting to the end of the line (the machine had run out of railway line) and had to get to rescue point. The machine had written (laser cut?) the message 'RAG (or RAAG) RULES OK' on the wall in the last tunnel.
EDIT - was read in Australia