If ICO hadnt raised the required sum is it considered failed and what founders of the company obliged to do with sold tokens and their investors?
It depends by the terms of the ICO your are investing in.
Some ICO will refund users if they do not reach a minimum amount of funds before the end date scheduled for the ICO itself.
Some others ICO can however hold the funds also if they do not have reached the maximum cap and if they haven't set a minimum cap to consider ICO successful.
Every ICO has its own terms & details, and different specifications about timelines, roadmaps, coins/tokens distribution etc.
You should do your due diligence and read carefully the ICO terms each time you are willing to send funds to any projects.
Hope this helps.