Probably for the same reason that the curtains separating the cabins must be completely open during take-off and landing. Of course, that could be solved technically (wall that slides downward to open the compartment). But I don't think there are train compartments with reclining seats -> less comfort and more effort for the crews during service. There is also a potential safety issue: air-rage in a closed compartment might be stopped too late.
Well, a few compartment-like interiors can be found. Like
http://www.airliners.net/open.file/1022215/L/
I've never seen a train ride that costs 9000 Euro for a 10 hour trip... If it did cost even half that much I'd almost expect my whole carriage for myself...
There is no doubt for me that lie-flat seats are a fabulous idea on long-hauls.
HTB.
How much does a 10 hour train ride in a seat cost?
Look at it this way: take, for example, a Transsiberian first class car.
A compartment there is 210 cm long and wide. 70 cm wide door and aisle in the middle, two 70 cm wide and 200 cm long beds on sides. The car has 9 of them - for a total of 18 tickets. It has 2 toilets in the ends and 2 attendants.
In about the same size of car (19 m length plus the thickness of compartment walls), you should be able to have, say, 24 rows of seats at 81 cm pitch. Total of 96 seats if 4 abreast, or 120 seats 5 abreast. 2 attendants and 2 toilets would not be out of place for a 96 seat all-economy plane.
Now, could you fill a second-class car with, say, 9 rows of lie-flat sleeper First Class seats, 3 abreast and little privacy?
Railways do not do this. Instead, the next lower class on Transsiberian is again 9 compartments, but 4 berths each, with upper berths.
The next lower one does not have compartment doors - what it does have is still compartment walls, but 6 berths, 4 across car as usual, and 2 - 1 lower and 1 upper - alongside the opposite wall.
Why do railways prefer upper berths to sleeper seats?
I think Boeing 307 and 314 also have berths across fuselage.