How can I autopopulate titles in the media library?

If you can do SQL manually then try:

UPDATE wp_posts p INNER JOIN wp_posts q ON p.post_type="attachment" AND p.post_mime_type LIKE 'image/%' AND (p.post_title IS NULL OR LENGTH(p.post_title) = 0) AND p.post_parent = q.ID SET p.post_title = q.post_title;

If you need a PHP function then try:

function set_image_without_title_to_post_title() {
  global $wpdb; 

  $sql = sprintf( "UPDATE %s p INNER JOIN %s q "
    . "ON p.post_type="attachment" AND p.post_mime_type LIKE 'image/%%' " 
    . "AND (p.post_title IS NULL OR LENGTH(p.post_title) = 0) "
    . "AND p.post_parent = q.ID "
    . "SET p.post_title = q.post_title",
    $wpdb->posts, $wpdb->posts );

  $wpdb->get_results( $sql, ARRAY_A );
}

WARNING: As this will make massive changes to your database I would do a backup first!
I did run a small test and it appears to be correct but USE AT YOUR OWN RISK!