As to which preposition you should use, there is no strict rule about that. However, in your example, I feel that using in the cities with of the villages creates a variation that is needless and slightly less eloquent. You are directly comparing two things (houses) in very similar situations (in cities v. villages). This kind of variation is possible, but stylistically inadvisable, so I would use the same preposition with both. If you were comparing houses in different situations, as in houses along the river are usually larger than those on mountain tops, then you have a good reason to use different prepositions, and you have no other choice anyway.
As to that (singular) v. those (plural), the pronoun should have the same number as the noun it is replacing, which could be either plural or singular, depending on what you mean. If what you mean is this:
The houses in the cities are more beautiful than *the house in the villages.
Then you would need the singular pronoun. However, the real world makes this sentence nearly impossible, so I'm quite sure you are referring to more than one house: you can't have one house in several villages (plural) in reality. As usual, context restricts your syntactic options. So you must use those here:
The houses in the cities are more beautiful than those in the villages.
As to the article (the cities and the villages), you may have a reason to use the article with one noun and no article with the other; however, I see no such reason here, and you would normally want to use articles consistently in a situation like this, so I would recommend that you use the either with both, or with neither.
The way young children are introduced to prepositions (including multi-word examples) is by being shown pictures illustrating static spatial (locative) relationships ('the box is beside / under / in front of / next to / on top of / on the left of / near (to) ... the table). This is a semantic treatment. Directional relationships come next, then temporal. Non space/time, including the slightly- and highly-idiomatic, usages of prepositions are introduced later, with a necessary re-emphasis on syntactic properties. Prepositions are neither wholly functional nor wholly lexical words, when considered in all their usages.
In Grammar: A Student's Guide, Hurford cites some 'intercategorial polysemes' which nicely illustrate the differences between 'subordinating conjunctions' ('subordinators' may be a more useful term) and prepositions.
Other sources such as
show analyses of prepositions and their use.
The coordinator class is defined purely in terms of syntactic function:
'Coordinating conjunctions, also called coordinators, are
conjunctions that join, or coordinate, two or more items (such as
words, main clauses, or sentences) of equal syntactic importance.'
(Wikipedia) ('Importance' in this sense means one can't have (3) here:
(1) 'bacon and eggs is on the menu' (2) 'I like gammon and Jill likes
pineapple' (3) 'bacon and Jill likes pineapple'.
'Position in the syntactic hierarchy' is probably a better term.
But if you look at the uses of prepositions Cowan cites, you'll find (I think) they 'relate' structures of unequal syntactic 'importance'.
Best Answer
Both ways of saying it are correct. However, no. 2 is more appropriate, i think.