It won't prevent, it can reduce the harm of drinking soda, but only in a specific usage, which is not the common one, using a straw in the "wrong" way would cause more damage to the teeth.
The article in question cites the article Influence of drinking patterns of carbonated beverages on dental erosion which reviews two case studies of teens (16 and 18 years old), the very bad state of their teeth and the high amount of soda that they intake. I couldn't find the full text of the article, but in the abstract of the study the authors state:
Several preventive means have been proposed to minimize the damage to the dentition, including a reduction in the consumption of causative beverages and the adoption of a specific method of drinking, utilizing a straw instead of a cup.
The clinical and radiographic evidence presented in this report cautions against the use of nonspecific terms, such as "cup versus straw," and instead suggests implementing a more precise description of the suggested method.
This article is also cited in a later review article Insights into preventive measures for dental erosion which again cautions against using a straw:
Special drinking habits, such as holding or moving the liquid in the mouth prior to swallowing, sucking from a straw or nipping from a bottle, lead to an increased acid contact time in the oral cavity and, thus, to prolonged duration of an acidic pH-value in the environment of the teeth.
However, as the article in the question suggests if used properly, specifically, if the straw is placed in such a way that the straw is positioned behind the teeth it leads to less contact between the teeth and the acids in the soda, as was described in the article A videofluoroscopic comparison of straw and cup drinking: the potential influence on dental erosion.
Fourteen patients avoided fluid contact with both incisors and molars when using a straw. Compared with the cup, significant differences were found with the narrow straw (P = 0.03, 95% confidence interval of 22.6% to 31.6%), the narrow straw repositioned (P = 0.008, 95% confidence interval of 12.3% to 47.1%) and the wide straw repositioned (P = 0.03, 95% confidence interval of 3.1% to 37.5%). Contact time of fluid with anterior teeth was also significantly reduced. CONCLUSIONS: Drinking through a straw positioned toward the back of the mouth may reduce the erosive potential of soft drinks.
Conclusion, while it's true that using a straw may reduce the harm from sodas and other acidic liquids, it needs to be used in a position which is not common by most people. And if used in the common way, will lead to more harm. Because of this, the articles don't recommend giving non-specific advice such as "use straw over cup".