How important it is to have heavier / lighter freight cars in specific order in the train to prevent string-lining?
That depends on several factors that include curves, grades, superelevation, speed, train length and the cars themselves.
Do I need to put the die-cast scale cars closer to the power, and lighter cars in the rear and go down in weight?
That is a good practice to follow for reliable operation. As Hot Water pointed out real railroads do this for better train handling. They can have very specific rules that govern the order of cars in a train depending on the tonnage, power, specific car types and specific routes. You may also find similar specific rules that work on your model railroad to prevent derailments.
Let's say the curves are super-elevated O-72, O-84 and O-96; and its a 18-car scale freight train.
On curves O-72 and above I have found that trains up to about 20 modern O SCALE freight cars will run very reliably without much consideration of car order in the train. And that includes curves with slight superelevation.
If you have some super light O-27 MPC era cars in the mix all bets are off. The same goes for older plastic trucked Weaver cars.
If you put ten Lionel PS-1 box cars ahead of ten K-Line diecast cars all bets are off as well.
If you run 50 SMPH through an O-72 curve you are on your own. Realistic speeds are required for reliable operation.
But Atlas, Lionel and MTH have all done a pretty good job of building cars that are at or slightly above the NMRA recommendation. The Atlas Master Line tends to be heavy at 19 to 20 ounces for most of their 40 foot cars. Atlas Trainman cars tend to be lighter but close to the NMRA recommended practice. Lionel 40 foot reefers and PS-1 box cars weight very close to the NMRA recommended weight of 15 ounces. Some Lionel Standard O cars like the mechanical reefer are heavy for their length and the ethanol tank cars are very light for their size. MTH is the most consistent. The premier line 40 foot box cars and reefers are 17 ounces out of the box. The MTH Railking freight cars are well weighted for "traditional" sized cars and tend to run well with scale equipment, even in longer trains.
If you are interested in car weight you can have a look at the O Scale Freight Car Guide. The weights of some types of cars are listed now and more data will be added as information is updated.
https://ogrforum.com/t...le-freight-car-guide