You can try the below code:

     
    ClientContext ctx = new ClientContext("http://server:port/sites/test");
    Web web = ctx.Web;
    List test = web.Lists.GetByTitle("Test Docs");
    ListItemCollection itemColl = test.GetItems(CamlQuery.CreateAllFoldersQuery());
    ctx.Load(itemColl, x => x.Include(
                           y => y.RoleAssignments.Include(z => z.Member),
                           y => y.DisplayName));
    ctx.ExecuteQuery();
    
    foreach (ListItem item in itemColl) 
    {
        Console.Write(item.DisplayName + " folder permissions are: ");
        foreach (RoleAssignment role in item.RoleAssignments)
        { 
            Console.Write(role.Member.Title + "\t");
        }
        Console.WriteLine("\n\n");
    }


Similar question is discussed here :

[How to get SharePoint Group Names having permission on Folder in SharePoint 2010][1]


  [1]: https://sharepoint.stackexchange.com/questions/219046/how-to-get-sharepoint-group-names-having-permission-on-folder-in-sharepoint-2010