I saw a clip of the movie and was very surprised by the physics of it: https://youtu.be/1aU52iLvPr0?t=302
Sounds impossible with what I know of old metallurgy (this is the 18th century, after all), but I also know blades were somewhat flexible and lighter than we usually imagine.
I guess the answer might simply be "Bollywood", but it would be bizarre if it didn't have an explanation, since it obviously surprises people watching. Is this trying to represent some legend about the sword of the real Baji Rao? I know sometimes swords are given weird properties in legends (like the Zulfiqar of Ali). Or was there really some kind of Indian sword with blades so thin that it was more flexible than usual, and the movie just exaggerates that?
Edit: I have been informed that this weapon indeed existed, which surprises me since I hadn't found it in my googling and browsing Wikipedia about Baji Rao. I have now been alerted to the fact that if I had just googled "Indian flappy sword" it would have showed up in the results [insert facepalm].
So I refocus my question: was this kind of sword used in the times of Baji Rao? What was its prevalence and how would it be used in combat? Looks dangerous for those next to you in a formation. Was it effective at all compared with a regular (non-flappy) sword?
The Indian whip sword (urumi or chuttuval) has very little historical visibility. The main (older) books on Indian arms mention them not (P. S. Rawson, The Indian Sword, Jenkins, 1968; G. N. Pant, Indian Arms and Armour, Army Educational Stores, Chandigarh, 1978; and Stone's Glossary and Egerton, Indian and Oriental Arms and Armour don't mention it either). I know of no antique examples (if you do, please let me know!). This suggests that it was a rare weapon when it existed.
The urumi appears in the Vadakkan Pattukal, AKA the "Northern Ballads", a group of old ballads of north Malabar (see K. S. Mathew, Society in Medieval Malabar: A Study Based on Vadakkaṅ Pāṭṭukaḷ, Jaffe Books, 1979). It's a weapon of heroes, with notable users being Thacholi Othenan and Unniyarcha. Unniyarcha on one occasion uses a wet towel as a non-lethal substitute for her urumi, so clearly a very flexible weapon is meant. These ballads are set in the 15th and 16th century, and their composition could easily be older than Bajirao, so the answer to your question
was this kind of sword used in the times of Baji Rao?
appears to be "yes".
But it was rare, and I don't know of any examples of Marathas using the urumi (their heroes used either the common weapons of the Marathas, or the patta, the gauntlet sword). Therefore, it's unlikely that Bajirao used the urumi. The patta often has a relatively flexible blade (as do long-bladed Indian firangi, swords with long straight European cavalry sword blades or similar Indian-made blades); these aren't floppy blades like the urumi, but can be easily flexed by hand, often past 45 degrees. Perhaps the attribution of a urumi is based on this flexibility?
As you note, trying to use the urumi on the battlefield would lead to problems due to one's comrades. It's a specialised duelling weapon, designed to be an unfamiliar and scary secret weapon. It does have the advantages of reach and of being difficult to block (since it can wrap around). Comparable Japanese and Chinese weapons - also specialised "secret" duelling weapons include the kusarigama (ball-sickle-chain) and 9-section-whip, which have the flexibility and length (but depend on a weight at the end for effect, rather than a sharp edge). Judging by these weapons, the urumi could be dangerous in a duel, especially if unfamiliar and approached without care, but isn't a super-weapon. Longer range, harder to block, but less lethal/damaging than a normal sword or spear.
For some of the weapons Bajirao would have been likely to use, see Apte, B. K. “THE MARATHA WEAPONS OF WAR.” Bulletin of the Deccan College Research Institute, vol. 19, no. 1/2, 1958, pp. 106–124. JSTOR, JSTOR, www.jstor.org/stable/42929716
The blade used in the movie is the urumi, a weapon used mostly in Kerala and Tamil Nadu.
We know exactly how the urumi operates because it is still used in kalaripayattu, the ancient martial arts of Kerala. From watching kalaripayattu it is clear what the advantages and disadvantages of urumi are.
Advantages
Facing multiple enemies at the same time: When surrounded by multiple enemies, the flexibility of the urumi allows you to attack all of them at once by constantly moving the hilt in a circular fashion.
Constantly harassing an opponent and pressurizing him to make a mistake: The opponent would always be on the defensive due to the rapid motion of the blade and unable to make his own attacking moves. Of course this is only possible if the urumi wielder is super skilled.
Attacking around shields: because of its flexibility, it could bend around a shield and land a blow on the other side, making a shield less useful.
Easy to conceal: flexible swords can be tied around the waist like a belt, making travel easy.
Reach: because it is easy to fold, it can be made longer which gives it a larger reach than traditional swords.
Because it is light and needs dexterity more than strength, it can be wielded well by women
Disadvantages
Massed formations or cavalry have no use for the urumi. You would end up slashing your own horse or fellow soldier.
There is a legitimate risk of hurting yourself, so you need extreme control to prevent that from happening. An accidental parry could send the blade hurtling towards you.
The urumi cannot be used for a stabbing motion because of its 'floppy' nature.
Armour penetration is impossible with the urumi. Even penetrating thick clothing is difficult.
It is very difficult to control where the blade will land, which makes precise motions like aiming for an opponents' neck almost impossible.
The urumi is well-suited to Kerala's jungle warfare. Keralite warriors were usually lightly clad due to the heat and humidity - no armour. Warfare did not involve cavalry, again because of the marsh/jungles.
Given the circumstances, the urumi was great for mobility through the jungles and backwaters of Kerala, specially in amphibious warfare involving boats. It was most likely used for assassinations, bodyguard duties etc., where the element of surprise was necessary.
The urumi can be supposedly traced to the 3nd century BCE - around the time of the Sangam period in Tamil Nadu. However, I would treat this date with skepticism.
It is highly unlikely. There is no mention of a flexible sword like the urumi for any period of time in Maharashtrian history before the Marathas or during their empire, nor do we have any specimens from the period of Maratha rule.
The somewhat flexible dand patta has been used by the Marathas in some battles, most notably by the Maratha commander Baji Prabhu Deshpande in the Battle of Pavan Khind which saw a heroic last stand by 300 Maratha soldiers vs 10000 Siddi soldiers. Variants of the dand patta are still used in re-enactments and stunt shows in rural Maharashtra.
However, the dand patta differs from the urumi significantly - its blade was not as flexible and the patta had an integrated gauntlet which restricted wrist freedom in exchange for protection. It was a very flexible 'traditional' sword as opposed to the urumi which is closer to a whip with two sharp edges.
Regarding the Peshwa himself, Bajirao was renowned as a cavalry general. Commanders like Bajirao were almost always on horseback and would have wielded firangis - European style longswords made of Solingen steel or imitations of that. Being on horseback, it is unlikely that he would have been trained to use the urumi, which requires extensive training (as seen from kalaripayattu) and would have been useful only if he were on foot (and other special situations).
Source: By Sweat and Sword: Trade, Diplomacy and War in Kerala Through the Ages, K. K. Nair