Hello,
1) You have stated that you could resign and be terminated without serving any notice period during the first six months of your employment and that is why you need to serve a notice before you can sever your service to the company. even if there is stipulation about notice you can get away with a shorter notice and in lieu of complete notice you may have to forgo your basic salary.
2) As such the company can not withhold your relieving arbitrarily. You can issue a legal notice demanding acceptance of your resignation and issuance of relieving letter.
3) The cost involved depends on the lawyer you would engage as the fee in such cases is subective. If the company refuses to part with the letter and comply despite the legal notice you will have to file a suit against the company for the reliefs and claim heavy damages.