There is no evidence to suggest that being underground/confined spaces can actually be a weakness for Titans. However there isn't any evidence supporting the contrary as well.
A definite strategic disadvantage of underground transformation is obvious (due to the restricted space for movement and the lack of visibility).
However in the corresponding chapter, you would do well to notice that the Titan smashes the tunnel from outside, all too easily. So underground colonization is a definite NO.
There is also no hard evidence on whether sunlight is a primary source of power for Titans. If that were the case, then Annie's transformation in the forest would have degenerated (no/minimal sunlight there).
Also (as suggested by @mirroroftruth), the use of forests is mainly because of the better 3D maneuver environment. However from my perception, undergrounds are just as bad an environment for 3D maneuvers, as they may be for Titans.