Sometimes children do not feel secure in their own room by themselves. As long as you allow them to work it out themselves eventually they will be comfy and sleep.
Your two year old toddler could be having a separation issue. Being apart from the parent can be a difficult adjustment. Your toddler could also be afraid of the dark, try a teddy that sings or night light.