Hello,
First of all in order to appear for UPSC, candidates are required to pass Bachelor's Degree in any discipline from a recognized university, hence definitely with BAMS degree you're eligible for the same. Medical Science is there as an optional subject which you can consider, the syllabus is quite vast yet static but if we see in recent times then many topper have succeeded in UPSC with medical science as an optional, hence you can consider this option, go through the syllabus first, and analyze accordingly, if you're comfortable covering the subject you can definitely give it a try.
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile