Yes, idling a car charges the battery, but it takes a lot more time to charge it that way when compared to driving your car. When driving and revving your car, the alternator works harder and provides a more powerful charge to the battery.