To the best of my knowledge: You can't retain formatting such as column widths in a CSV file.

So the code may well does work, but when saving the CSV file and closing it, the column widths are lost again.
Try manually to change the column width, then save the CDV file and close it. Re-open the file. Columns will be back to default.

You could open the CSV files, autofit, then save as excel files if that does not cause other issues on how you need to work with these files.