Which of these build numbers will tell me what version of SQL Server is installed on a server?
Yes, you can query the database to find out the version via sqlcmd.

The actual SQL you'll want to use is just SELECT @@VERSION but to do it via sqlcmd, you can use:

sqlcmd -S[server] -U[user] -P[password] -q "SELECT @@VERSION"

Also check the MS sqlcmd reference for further info on flags you can use with sqlcmd.