You can apply for a UK visa from any location where a Visa Application Processing Center (VAC) is located. It is not necessary that it be from your country of residence. So you can apply from Sweden. A standard visitor visa costs £ 93 and usually takes up to 3 weeks (it can sometimes be longer) https://www.gov.uk/standard-visitor-visa
It should be possible to complete the online application in India and to take a biometric appointment in a VAC in Sweden. However, if you do not plan to be in Sweden for at least three weeks, you may not have the decision. and so your passport, in time. A "keep my passport" option may help you to solve this problem, although there is still a risk that you will not receive the decision on time.