Yes, you can use the the eligible line to upgrade. However, keep in mind that you would need to call AT&T once the phone arrives and update the IMEI on your line so the appropriate data plan is put in place.
You would also give them the IMEI of the second phone (the old one on the second line) so that they ca continue using that phone as normal.
*The views and opinions expressed on this forum are purely my own. Any product claim, statistic, quote, or other representation about a product or service should be verified with the manufacturer, provider, or party.