Both examples are perfectly grammatical, and a fluent speaker would understand and might use either.
It will take an hour for the room to get/be painted.
is the standard way to express this concept using the passive voice. There is no significant difference in meaning between the use of "get" and the use of "be" in this example, that is just a matter of style.
The equivalent using the active voice would be one of:
- It will take the workers an hour to paint the room.
- It will take the workers an hour to get the room painted.
Again there is no significant difference. The version using "get" emphasizes the result a bit more, while the version using "be" emphasizes the process a bit more. The version with "get" is perhaps slightly less formal. But the essential meaning is the same.
It will take the room an hour to get/be painted.
is a little more unusual. It is still in the passive voice, in that the subject of "be painted" is "the room" which receives the action, rather than performing it. The actual agent is unspecified, as is often the case in a passive construction. But this construction tempts the reader or listener to imagine that the room somehow paints itself. Indeed, these days it is just possible to imagine an automated room that does paint itself, perhaps with cartoon arms that sprout from the walls, wielding paint brushes.
This possible confusion can make the reader or listener stop and think, and thus break the flow of the text. That probably makes this a less desirable construction.
Again, the use of "get" focuses on the result, without changing the meaning significantly.