Tomatoes ripen in six stages, starting with the green mature stage, when the fruits are too immature to ripen indoors and will likely rot before they can ripen for fresh eating.
The next step is the breaker stage, when tomatoes start producing ethylene gas that helps the fruits ripen. This is when these tomatoes can be brought indoors to ripen.
Beyond this stage, tomatoes ripen on their own even without nutrients from plants or sunlight, so there's really no need for them to be placed near sunny windowsill.